summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-15 21:11:25 (GMT)
committerBrett Cannon <brett@python.org>2013-06-15 21:11:25 (GMT)
commit9529fbfd363959ee4e33baeebcc6c3bc0252b42c (patch)
treedd983d37097a74680b5037f287dc83aa9391bd36 /Lib/test/test_zipimport.py
parent8a2a902f88ce2ab8d0e27a189a65e71aed6dd670 (diff)
downloadcpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.zip
cpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.tar.gz
cpython-9529fbfd363959ee4e33baeebcc6c3bc0252b42c.tar.bz2
Issue #17177: Stop using imp in a bunch of tests
Diffstat (limited to 'Lib/test/test_zipimport.py')
-rw-r--r--Lib/test/test_zipimport.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 2e2297b..3f16041 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -1,7 +1,7 @@
import sys
import os
import marshal
-import imp
+import importlib.util
import struct
import time
import unittest
@@ -34,7 +34,8 @@ def make_pyc(co, mtime, size):
mtime = int(mtime)
else:
mtime = int(-0x100000000 + int(mtime))
- pyc = imp.get_magic() + struct.pack("<ii", int(mtime), size & 0xFFFFFFFF) + data
+ pyc = (importlib.util.MAGIC_NUMBER +
+ struct.pack("<ii", int(mtime), size & 0xFFFFFFFF) + data)
return pyc
def module_path_to_dotted_name(path):
@@ -49,7 +50,7 @@ TESTPACK = "ziptestpackage"
TESTPACK2 = "ziptestpackage2"
TEMP_ZIP = os.path.abspath("junk95142.zip")
-pyc_file = imp.cache_from_source(TESTMOD + '.py')
+pyc_file = importlib.util.cache_from_source(TESTMOD + '.py')
pyc_ext = ('.pyc' if __debug__ else '.pyo')