diff -r a3aba2148186 Lib/imp.py --- a/Lib/imp.py Tue Jun 26 14:08:15 2012 -0400 +++ b/Lib/imp.py Tue Jun 26 16:17:25 2012 -0400 @@ -11,7 +11,7 @@ init_builtin, init_frozen, is_builtin, is_frozen, _fix_co_filename, extension_suffixes) # Could move out of _imp, but not worth the code -from _imp import get_magic, get_tag +from _imp import get_magic from importlib._bootstrap import new_module from importlib._bootstrap import cache_from_source @@ -37,6 +37,11 @@ IMP_HOOK = 9 +def get_tag(): + """Return the magic tag string for the current version of Python's + magic number, as defined by the current implementation""" + return sys.implementation.cache_tag + def get_suffixes(): warnings.warn('imp.get_suffixes() is deprecated; use the constants ' 'defined on importlib.machinery instead', diff -r a3aba2148186 Lib/importlib/_bootstrap.py --- a/Lib/importlib/_bootstrap.py Tue Jun 26 14:08:15 2012 -0400 +++ b/Lib/importlib/_bootstrap.py Tue Jun 26 16:17:25 2012 -0400 @@ -1452,7 +1452,7 @@ # 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()) + setattr(self_module, '_TAG', sys.implementation.cache_tag) if builtin_os == 'nt': SOURCE_SUFFIXES.append('.pyw')