summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-06-15 16:59:53 (GMT)
committerBrett Cannon <brett@python.org>2013-06-15 16:59:53 (GMT)
commit61c3556c14d52e553ca5eecc4e178124fac75167 (patch)
treeecadf6dc78159a42de1f2173599e2eb9a7c29254 /Lib/distutils/util.py
parent7822e123c42b63c5819e0b6cca6f960b1ce55547 (diff)
downloadcpython-61c3556c14d52e553ca5eecc4e178124fac75167.zip
cpython-61c3556c14d52e553ca5eecc4e178124fac75167.tar.gz
cpython-61c3556c14d52e553ca5eecc4e178124fac75167.tar.bz2
Issue #17177: Stop using imp in distutils
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r--Lib/distutils/util.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index e241f59..257de68 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -6,7 +6,7 @@ one of the other *util.py modules.
import os
import re
-import imp
+import importlib.util
import sys
import string
from distutils.errors import DistutilsPlatformError
@@ -453,9 +453,10 @@ byte_compile(files, optimize=%r, force=%r,
# cfile - byte-compiled file
# dfile - purported source filename (same as 'file' by default)
if optimize >= 0:
- cfile = imp.cache_from_source(file, debug_override=not optimize)
+ cfile = importlib.util.cache_from_source(
+ file, debug_override=not optimize)
else:
- cfile = imp.cache_from_source(file)
+ cfile = importlib.util.cache_from_source(file)
dfile = file
if prefix:
if file[:len(prefix)] != prefix: