diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-31 16:38:40 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-31 16:38:40 -0500 |
commit | ddb91c20793d8e5e8a01e0302afeaaba76776741 (patch) | |
tree | f766bb05b28adefdad9e88c5043391bc01f63c61 /setuptools | |
parent | 952c1bafda1929c74c737646aa025e6ffad6632e (diff) | |
download | external_python_setuptools-ddb91c20793d8e5e8a01e0302afeaaba76776741.tar.gz external_python_setuptools-ddb91c20793d8e5e8a01e0302afeaaba76776741.tar.bz2 external_python_setuptools-ddb91c20793d8e5e8a01e0302afeaaba76776741.zip |
Make the technique even more generic
--HG--
branch : feature/issue-229
Diffstat (limited to 'setuptools')
-rw-r--r-- | setuptools/extern/six.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/setuptools/extern/six.py b/setuptools/extern/six.py index 2685c5e6..6076c208 100644 --- a/setuptools/extern/six.py +++ b/setuptools/extern/six.py @@ -1,11 +1,11 @@ """ -Handle loading six package from system or from the bundled copy +Handle loading a package from system or from the bundled copy """ import imp -_SIX_SEARCH_PATH = ['setuptools._vendor.six', 'six'] +_SEARCH_PATH = ['setuptools._vendor.six', 'six'] def _find_module(name, path=None): @@ -24,7 +24,7 @@ def _find_module(name, path=None): return fh, path, descr -def _import_six(search_path=_SIX_SEARCH_PATH): +def _import_in_place(search_path=_SEARCH_PATH): for mod_name in search_path: try: mod_info = _find_module(mod_name) @@ -32,15 +32,14 @@ def _import_six(search_path=_SIX_SEARCH_PATH): continue imp.load_module(__name__, *mod_info) - break else: raise ImportError( - "The 'six' module of minimum version {0} is required; " + "The '{name}' package is required; " "normally this is bundled with this package so if you get " "this warning, consult the packager of your " - "distribution.") + "distribution.".format(name=_SEARCH_PATH[-1])) -_import_six() +_import_in_place() |