diff options
author | SARL ENR 68 <david@david.david> | 2015-08-28 20:08:12 +0200 |
---|---|---|
committer | SARL ENR 68 <david@david.david> | 2015-08-28 20:08:12 +0200 |
commit | 0e0672380f7db341e3966906b9fa73d16b4f49a8 (patch) | |
tree | e3f6d88f23156496c9b90f1b5a153ac45bccc73f | |
parent | a3a185fdf46f25d4c8321b478427cc14987d62db (diff) | |
download | msec-0e0672380f7db341e3966906b9fa73d16b4f49a8.tar msec-0e0672380f7db341e3966906b9fa73d16b4f49a8.tar.gz msec-0e0672380f7db341e3966906b9fa73d16b4f49a8.tar.bz2 msec-0e0672380f7db341e3966906b9fa73d16b4f49a8.tar.xz msec-0e0672380f7db341e3966906b9fa73d16b4f49a8.zip |
Syntax corrections for string replace, join and for os.error (mga#16524)
- by papoteur: https://bugs.mageia.org/attachment.cgi?id=6913
-rwxr-xr-x | src/msec/libmsec.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index bf6a242..95b5060 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -86,7 +86,7 @@ def move(old, new): def substitute_re_result(res, s): for idx in range(0, (res.lastindex or 0) + 1): subst = res.group(idx) or '' - s = string.replace(s, '@' + str(idx), subst) + s = s.replace('@' + str(idx), subst) return s # }}} @@ -378,7 +378,7 @@ class ConfigFile: try: os.unlink(self.path) except: - error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) + os.error('unlink %s: %s' % (self.pathN, str(sys.exc_info()[1]))) self.log.info(_('deleted %s') % (self.pathN,)) elif self.is_touched: if os.path.exists(self.path): @@ -431,7 +431,7 @@ class ConfigFile: self.log.info(_('moved file %s to %s') % (self.path, self.path + self.suffixN)) self.meta.modified(self.path) elif self.is_modified: - content = string.join(self.lines, "\n") + content = "\n".join(self.lines) dirname = os.path.dirname(self.path) if not os.path.exists(dirname): os.makedirs(dirname) |