Convert the whole files/ directory to py3 syntax (#3685)

This commit is contained in:
Michael Scherer 2016-05-18 16:01:53 +02:00 committed by Matt Clay
commit f7b29ba8fd
7 changed files with 36 additions and 18 deletions

View file

@ -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: