mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Use 'except ... as' syntax
This syntax works on Python 2.6 through 3.x. lib/ansible/module_utils (and lib/ansible/modules) need to support Python 2.4, so I didn't touch those.
This commit is contained in:
@@ -45,6 +45,6 @@ def makedirs_safe(path, mode=None):
|
||||
os.makedirs(path, mode)
|
||||
else:
|
||||
os.makedirs(path)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
if e.errno != EEXIST:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user