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 | cac10881a6f2c2a9d3e76bcca3918b8065d9b3eb (patch) | |
tree | 50b15b2931b4708f14d6cdf9efea06a014a9c124 | |
parent | d93c343d2612589b9d9b81b5b038425bb931f5f6 (diff) | |
download | python-setuptools-bitbucket-cac10881a6f2c2a9d3e76bcca3918b8065d9b3eb.tar.gz |
Make the technique even more generic
-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() |