diff options
author | Brett Cannon <brett@python.org> | 2012-04-21 22:55:51 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-21 22:55:51 (GMT) |
commit | 2f92389d5c477cb15a0b70e22f11e835eb077224 (patch) | |
tree | 9b56cf4aca979c0689d97d0f7710d547532d86a0 /Lib | |
parent | b582c923ba4b0833e840360994743b68e0dfe219 (diff) | |
download | cpython-2f92389d5c477cb15a0b70e22f11e835eb077224.zip cpython-2f92389d5c477cb15a0b70e22f11e835eb077224.tar.gz cpython-2f92389d5c477cb15a0b70e22f11e835eb077224.tar.bz2 |
Don't worry about moving imp.get_tag() over to Lib/imp.py.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/imp.py | 4 | ||||
-rw-r--r-- | Lib/importlib/_bootstrap.py | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -11,9 +11,9 @@ from _imp import (lock_held, acquire_lock, release_lock, reload, init_builtin, init_frozen, is_builtin, is_frozen, _fix_co_filename) # Could move out of _imp, but not worth the code -from _imp import get_magic +from _imp import get_magic, get_tag # Can (probably) move to importlib -from _imp import (get_tag, get_suffixes) +from _imp import get_suffixes # Should be re-implemented here (and mostly deprecated) from _imp import (find_module, NullImporter, SEARCH_ERROR, PY_SOURCE, PY_COMPILED, C_EXTENSION, diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index ea98a68..fb233cb 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -201,7 +201,7 @@ def _cache_from_source(path, debug_override=None): suffix = DEBUG_BYTECODE_SUFFIX if debug else OPT_BYTECODE_SUFFIX head, tail = _path_split(path) base_filename, sep, _ = tail.partition('.') - filename = ''.join([base_filename, sep, _imp.get_tag(), suffix]) + filename = ''.join([base_filename, sep, _TAG, suffix]) return _path_join(head, PYCACHE, filename) @@ -1148,6 +1148,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0): _MAGIC_NUMBER = None # Set in _setup() +_TAG = None # Set in _setup() def _setup(sys_module, _imp_module): @@ -1197,6 +1198,7 @@ def _setup(sys_module, _imp_module): # Constants setattr(self_module, '_relax_case', _make_relax_case()) setattr(self_module, '_MAGIC_NUMBER', _imp_module.get_magic()) + setattr(self_module, '_TAG', _imp.get_tag()) if builtin_os == 'nt': SOURCE_SUFFIXES.append('.pyw') |