diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-07-01 18:37:37 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-07-01 18:37:37 +0200 |
commit | 0b746fa27a94ea7d1dab5aafe7cb9ab476ccb623 (patch) | |
tree | b7f6732736e387d731d28da9da3159a6c2ae95e3 /modutils.py | |
parent | 13825514749b3577d9c7df11a848c1ecbc0d1cba (diff) | |
download | logilab-common-0b746fa27a94ea7d1dab5aafe7cb9ab476ccb623.tar.gz |
don't raise string exception in testlib (closes #35331)
Diffstat (limited to 'modutils.py')
-rw-r--r-- | modutils.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/modutils.py b/modutils.py index e71e172..1f66e26 100644 --- a/modutils.py +++ b/modutils.py @@ -18,11 +18,6 @@ # with logilab-common. If not, see <http://www.gnu.org/licenses/>. """Python modules manipulation utility functions. - - - - - :type PY_SOURCE_EXTS: tuple(str) :var PY_SOURCE_EXTS: list of possible python source file extension @@ -161,7 +156,7 @@ def load_module_from_modpath(parts, path=None, use_sys=1): return module -def load_module_from_file(filepath, path=None, use_sys=1): +def load_module_from_file(filepath, path=None, use_sys=1, extrapath=None): """Load a Python module from it's path. :type filepath: str @@ -183,7 +178,8 @@ def load_module_from_file(filepath, path=None, use_sys=1): :rtype: module :return: the loaded module """ - return load_module_from_modpath(modpath_from_file(filepath), path, use_sys) + modpath = modpath_from_file(filepath, extrapath) + return load_module_from_modpath(modpath, path, use_sys) def _check_init(path, mod_path): |