summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.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/support.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/support.py')
-rw-r--r--Lib/test/support.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 9baedb4..be1c428 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -15,10 +15,10 @@ import shutil
import warnings
import unittest
import importlib
+import importlib.util
import collections.abc
import re
import subprocess
-import imp
import time
import sysconfig
import fnmatch
@@ -316,7 +316,7 @@ def make_legacy_pyc(source):
does not need to exist, however the PEP 3147 pyc file must exist.
:return: The file system path to the legacy pyc file.
"""
- pyc_file = imp.cache_from_source(source)
+ pyc_file = importlib.util.cache_from_source(source)
up_one = os.path.dirname(os.path.abspath(source))
legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o'))
os.rename(pyc_file, legacy_pyc)
@@ -335,8 +335,8 @@ def forget(modname):
# combinations of PEP 3147 and legacy pyc and pyo files.
unlink(source + 'c')
unlink(source + 'o')
- unlink(imp.cache_from_source(source, debug_override=True))
- unlink(imp.cache_from_source(source, debug_override=False))
+ unlink(importlib.util.cache_from_source(source, debug_override=True))
+ unlink(importlib.util.cache_from_source(source, debug_override=False))
# On some platforms, should not run gui test even if it is allowed
# in `use_resources'.