[#8530] convert exception handlers to except..as syntax
Futurize fixers: * lib2to3.fixes.fix_except
This commit is contained in:
@@ -373,7 +373,7 @@ def load_openerp_module(module_name):
|
||||
if info['post_load']:
|
||||
getattr(sys.modules['odoo.addons.' + module_name], info['post_load'])()
|
||||
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
msg = "Couldn't load module %s" % (module_name)
|
||||
_logger.critical(msg)
|
||||
_logger.critical(e)
|
||||
@@ -427,7 +427,7 @@ def get_test_modules(module):
|
||||
modpath = 'odoo.addons.' + module
|
||||
try:
|
||||
mod = importlib.import_module('.tests', modpath)
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
# If module has no `tests` sub-module, no problem.
|
||||
if str(e) != 'No module named tests':
|
||||
_logger.exception('Can not `import %s`.', module)
|
||||
|
||||
Reference in New Issue
Block a user