From 61c3556c14d52e553ca5eecc4e178124fac75167 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 15 Jun 2013 12:59:53 -0400 Subject: Issue #17177: Stop using imp in distutils --- Lib/distutils/command/build_py.py | 10 +++++----- Lib/distutils/command/install_lib.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Lib/distutils/command') diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index 1371b3d6ff..677723f0b1 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 15c08f1249..215813ba97 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 -- cgit v1.2.1