summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-21 22:55:51 (GMT)
committerBrett Cannon <brett@python.org>2012-04-21 22:55:51 (GMT)
commit2f92389d5c477cb15a0b70e22f11e835eb077224 (patch)
tree9b56cf4aca979c0689d97d0f7710d547532d86a0 /Lib/importlib
parentb582c923ba4b0833e840360994743b68e0dfe219 (diff)
downloadcpython-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/importlib')
-rw-r--r--Lib/importlib/_bootstrap.py4
1 files changed, 3 insertions, 1 deletions
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')