Mercurial > cpython-lru_cache-weakref
diff Lib/imp.py @ 76753:59b8a7fcb047
Properly mark names in importlib._bootstrap as private.
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Fri, 04 May 2012 13:52:49 -0400 |
| parents | 02f0bd296169 |
| children | 257cbd2fac38 |
line wrap: on
line diff
--- a/Lib/imp.py Fri May 04 11:06:09 2012 -0400 +++ b/Lib/imp.py Fri May 04 13:52:49 2012 -0400 @@ -15,8 +15,8 @@ # Can (probably) move to importlib from _imp import get_suffixes -from importlib._bootstrap import _new_module as new_module -from importlib._bootstrap import _cache_from_source as cache_from_source +from importlib._bootstrap import new_module +from importlib._bootstrap import cache_from_source from importlib import _bootstrap import os @@ -48,14 +48,14 @@ """ head, pycache_filename = os.path.split(path) head, pycache = os.path.split(head) - if pycache != _bootstrap.PYCACHE: + if pycache != _bootstrap._PYCACHE: raise ValueError('{} not bottom-level directory in ' - '{!r}'.format(_bootstrap.PYCACHE, path)) + '{!r}'.format(_bootstrap._PYCACHE, path)) if pycache_filename.count('.') != 2: raise ValueError('expected only 2 dots in ' '{!r}'.format(pycache_filename)) base_filename = pycache_filename.partition('.')[0] - return os.path.join(head, base_filename + _bootstrap.SOURCE_SUFFIXES[0]) + return os.path.join(head, base_filename + _bootstrap._SOURCE_SUFFIXES[0]) class NullImporter: @@ -185,7 +185,7 @@ for entry in path: package_directory = os.path.join(entry, name) - for suffix in ['.py', _bootstrap.BYTECODE_SUFFIX]: + for suffix in ['.py', _bootstrap._BYTECODE_SUFFIX]: package_file_name = '__init__' + suffix file_path = os.path.join(package_directory, package_file_name) if os.path.isfile(file_path):
