mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Convert the whole files/ directory to py3 syntax (#3685)
This commit is contained in:
parent
0027158b74
commit
f7b29ba8fd
7 changed files with 36 additions and 18 deletions
|
@ -181,7 +181,8 @@ def cleanup(path, result=None):
|
|||
if os.path.exists(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except (IOError, OSError), e:
|
||||
except (IOError, OSError):
|
||||
e = get_exception()
|
||||
# don't error on possible race conditions, but keep warning
|
||||
if result is not None:
|
||||
result['warnings'] = ['Unable to remove temp file (%s): %s' % (path, str(e))]
|
||||
|
@ -232,7 +233,8 @@ def main():
|
|||
if regexp != None:
|
||||
try:
|
||||
compiled_regexp = re.compile(regexp)
|
||||
except re.error, e:
|
||||
except re.error:
|
||||
e = get_exception()
|
||||
module.fail_json(msg="Invalid Regexp (%s) in \"%s\"" % (e, regexp))
|
||||
|
||||
if validate and "%s" not in validate:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue