improve plugin warning
This commit is contained in:
parent
ce8aa53270
commit
5454e8c19b
@ -270,9 +270,11 @@ class BasePluginManager(object):
|
|||||||
os.chdir(oldwd)
|
os.chdir(oldwd)
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
except ValueError as err:
|
except ValueError as err:
|
||||||
LOG.warning('Plugin error: %s', err)
|
LOG.warning("Plugin error (from '%s'): %s"
|
||||||
|
% (pdata.mod_name, err))
|
||||||
else:
|
else:
|
||||||
LOG.warning('Plugin error: %s', err)
|
LOG.warning("Plugin error (from '%s'): %s"
|
||||||
|
% (pdata.mod_name, err))
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
# Python2 on Windows not work with unicode in sys.path
|
# Python2 on Windows not work with unicode in sys.path
|
||||||
# but module can be loaded from current directory
|
# but module can be loaded from current directory
|
||||||
@ -283,9 +285,11 @@ class BasePluginManager(object):
|
|||||||
module = __import__(pdata.mod_name)
|
module = __import__(pdata.mod_name)
|
||||||
os.chdir(oldwd)
|
os.chdir(oldwd)
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
LOG.warning('Plugin error: %s', err)
|
LOG.warning("Plugin error (from '%s'): %s"
|
||||||
|
% (pdata.mod_name, err))
|
||||||
else:
|
else:
|
||||||
LOG.warning('Plugin error: %s', err)
|
LOG.warning("Plugin error (from '%s'): %s"
|
||||||
|
% (pdata.mod_name, err))
|
||||||
sys.path.pop(0)
|
sys.path.pop(0)
|
||||||
else:
|
else:
|
||||||
print("WARNING: module cannot be loaded")
|
print("WARNING: module cannot be loaded")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user