Converted except T,e expressions to except T as e

This commit is contained in:
Akita Noek
2016-06-27 13:14:36 -04:00
parent 7839db0c23
commit b57739a800
14 changed files with 37 additions and 37 deletions

View File

@@ -78,7 +78,7 @@ class MemObject(object):
v = yaml.safe_load(file(path, 'r').read())
if hasattr(v, 'items'): # is a dict
all_vars.update(v)
except yaml.YAMLError, e:
except yaml.YAMLError as e:
if hasattr(e, 'problem_mark'):
logger.error('Invalid YAML in %s:%s col %s', path,
e.problem_mark.line + 1,
@@ -1329,7 +1329,7 @@ class Command(NoArgsCommand):
self.logger.warning('Inventory import required %d queries '
'taking %0.3fs', len(queries_this_import),
sqltime)
except Exception, e:
except Exception as e:
if isinstance(e, KeyboardInterrupt):
status = 'canceled'
exc = e