-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Originally reported by: ericsnowcurrently (Bitbucket: ericsnowcurrently, GitHub: ericsnowcurrently)
Apparently pkg_resources is importing importlib._bootstrap, which is not meant to be directly imported. It is used later to get SourceFileLoader and FileFinder. I noticed this due to a failing test (test_venv) in the CPython suite when I moved both those classes to a different file (no longer in _bootstrap.py). See http://bugs.python.org/issue23911.
Starting in Python 3.3 the two classes are exposed in importlib.machinery. I'd recommend updating the code to look something like this:
if sys.version_info >= (3, 3) and sys.implementation.name == "cpython": from importlib.machinery import SourceFileLoader, FileFinder else: SourceFileLoader = FileFinder = None and update the rest of the file (3 spots) accordingly.