pluginmanager.better exception handling when importing modules
This commit is contained in:
parent
b9dc820161
commit
2512f29076
|
@ -415,9 +415,9 @@ class PluginManager(object):
|
||||||
try:
|
try:
|
||||||
module = __import__(module_name)
|
module = __import__(module_name)
|
||||||
except ValueError, value_error:
|
except ValueError, value_error:
|
||||||
pass
|
log.debug(value_error)
|
||||||
except ImportError, import_error:
|
except ImportError, import_error:
|
||||||
pass
|
log.debug(import_error)
|
||||||
|
|
||||||
elif os.path.isdir(file_path) and scan_dirs:
|
elif os.path.isdir(file_path) and scan_dirs:
|
||||||
module_name = elem_name
|
module_name = elem_name
|
||||||
|
@ -425,9 +425,9 @@ class PluginManager(object):
|
||||||
try:
|
try:
|
||||||
module = __import__(module_name)
|
module = __import__(module_name)
|
||||||
except ValueError, value_error:
|
except ValueError, value_error:
|
||||||
pass
|
log.debug(value_error)
|
||||||
except ImportError, import_error:
|
except ImportError, import_error:
|
||||||
pass
|
log.debug(import_error)
|
||||||
|
|
||||||
|
|
||||||
if module is None:
|
if module is None:
|
||||||
|
|
Loading…
Reference in New Issue