mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852)
This commit is contained in:
committed by
James Cammarata
parent
2d0e9cd75d
commit
658c15930e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user