mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #17177: Stop using imp in distutils
This commit is contained in:
parent
7822e123c4
commit
61c3556c14
7 changed files with 26 additions and 22 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue