diff options
author | Brett Cannon <brett@python.org> | 2013-06-15 16:59:53 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-06-15 16:59:53 (GMT) |
commit | 61c3556c14d52e553ca5eecc4e178124fac75167 (patch) | |
tree | ecadf6dc78159a42de1f2173599e2eb9a7c29254 /Lib/distutils/command | |
parent | 7822e123c42b63c5819e0b6cca6f960b1ce55547 (diff) | |
download | cpython-61c3556c14d52e553ca5eecc4e178124fac75167.zip cpython-61c3556c14d52e553ca5eecc4e178124fac75167.tar.gz cpython-61c3556c14d52e553ca5eecc4e178124fac75167.tar.bz2 |
Issue #17177: Stop using imp in distutils
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_py.py | 10 | ||||
-rw-r--r-- | Lib/distutils/command/install_lib.py | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index 1371b3d..677723f 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -3,7 +3,7 @@ Implements the Distutils 'build_py' command.""" import os -import imp +import importlib.util import sys from glob import glob @@ -312,11 +312,11 @@ class build_py (Command): outputs.append(filename) if include_bytecode: if self.compile: - outputs.append(imp.cache_from_source(filename, - debug_override=True)) + outputs.append(importlib.util.cache_from_source( + filename, debug_override=True)) if self.optimize > 0: - outputs.append(imp.cache_from_source(filename, - debug_override=False)) + outputs.append(importlib.util.cache_from_source( + filename, debug_override=False)) outputs += [ os.path.join(build_dir, filename) diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py index 15c08f1..215813b 100644 --- a/Lib/distutils/command/install_lib.py +++ b/Lib/distutils/command/install_lib.py @@ -4,7 +4,7 @@ Implements the Distutils 'install_lib' command (install all Python modules).""" import os -import imp +import importlib.util import sys from distutils.core import Command @@ -165,10 +165,10 @@ class install_lib(Command): if ext != PYTHON_SOURCE_EXTENSION: continue if self.compile: - bytecode_files.append(imp.cache_from_source( + bytecode_files.append(importlib.util.cache_from_source( py_file, debug_override=True)) if self.optimize > 0: - bytecode_files.append(imp.cache_from_source( + bytecode_files.append(importlib.util.cache_from_source( py_file, debug_override=False)) return bytecode_files |