Issue #15166: Re-implement imp.get_tag() using sys.implementation.

Also eliminates some C code in Python/import.c as well.

Patch by Eric Snow with verification by comparing against another
patch from Jeff Knupp.
This commit is contained in:
Brett Cannon 2012-07-02 15:13:11 -04:00
parent 8e2f5564b3
commit 98979b85e7
5 changed files with 194 additions and 195 deletions

View file

@ -1452,7 +1452,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())
setattr(self_module, '_TAG', sys.implementation.cache_tag)
if builtin_os == 'nt':
SOURCE_SUFFIXES.append('.pyw')