reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852)

This commit is contained in:
Timur Batyrshin
2014-02-02 21:33:27 +04:00
committed by James Cammarata
parent 2d0e9cd75d
commit 658c15930e
27 changed files with 118 additions and 118 deletions

View File

@@ -205,7 +205,7 @@ class SourcesList(object):
try:
f.write(line)
except IOError as err:
except IOError, err:
module.fail_json(msg="Failed to write to file %s: %s" % (tmp_path, unicode(err)))
module.atomic_move(tmp_path, filename)
else:
@@ -366,7 +366,7 @@ def main():
sourceslist.add_source(repo)
elif state == 'absent':
sourceslist.remove_source(repo)
except InvalidSource as err:
except InvalidSource, err:
module.fail_json(msg='Invalid repository string: %s' % unicode(err))
sources_after = sourceslist.dump()
@@ -378,7 +378,7 @@ def main():
if update_cache:
cache = apt.Cache()
cache.update()
except OSError as err:
except OSError, err:
module.fail_json(msg=unicode(err))
module.exit_json(changed=changed, repo=repo, state=state)