summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-15 22:10:18 (GMT)
committerBrett Cannon <brett@python.org>2013-06-15 22:10:18 (GMT)
commit53e600c24a9a7159d5396432e1228b3dbd80eb19 (patch)
tree0b81ec086420d9ad2e4c989d08d4380383177ac0 /Tools/scripts
parentca5ff3a069d8e5a1fca2ed305a3f53bdd51f727d (diff)
downloadcpython-53e600c24a9a7159d5396432e1228b3dbd80eb19.zip
cpython-53e600c24a9a7159d5396432e1228b3dbd80eb19.tar.gz
cpython-53e600c24a9a7159d5396432e1228b3dbd80eb19.tar.bz2
Issue #17177: update checkpyc to stop using imp
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-xTools/scripts/checkpyc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py
index 009f85b..bbaa3d1 100755
--- a/Tools/scripts/checkpyc.py
+++ b/Tools/scripts/checkpyc.py
@@ -5,11 +5,11 @@
import sys
import os
from stat import ST_MTIME
-import imp
+import importlib.util
# PEP 3147 compatibility (PYC Repository Directories)
-cache_from_source = (imp.cache_from_source if hasattr(imp, 'get_tag') else
- lambda path: path + 'c')
+cache_from_source = (importlib.util.cache_from_source if sys.implementation.cache_tag
+ else lambda path: path + 'c')
def main():
@@ -18,7 +18,7 @@ def main():
silent = (sys.argv[1] == '-s')
else:
verbose = silent = False
- MAGIC = imp.get_magic()
+ MAGIC = importlib.util.MAGIC_NUMBER
if not silent:
print('Using MAGIC word', repr(MAGIC))
for dirname in sys.path: