From 0e0672380f7db341e3966906b9fa73d16b4f49a8 Mon Sep 17 00:00:00 2001 From: SARL ENR 68 Date: Fri, 28 Aug 2015 20:08:12 +0200 Subject: Syntax corrections for string replace, join and for os.error (mga#16524) - by papoteur: https://bugs.mageia.org/attachment.cgi?id=6913 --- src/msec/libmsec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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) -- cgit v1.2.1