summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/command
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-10-19 06:18:05 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-10-19 06:18:05 (GMT)
commit4b5a5f7bd5c966648340b8bdbca54e836658cac7 (patch)
tree7ab407c8dbd8540c2db40d8d3a842a73d6eea9a9 /Lib/packaging/command
parent8ccd18fff334b9b9a32e9662684f59cac332c524 (diff)
downloadcpython-4b5a5f7bd5c966648340b8bdbca54e836658cac7.zip
cpython-4b5a5f7bd5c966648340b8bdbca54e836658cac7.tar.gz
cpython-4b5a5f7bd5c966648340b8bdbca54e836658cac7.tar.bz2
More fixes for PEP 3147 compliance in packaging (#11254)
Diffstat (limited to 'Lib/packaging/command')
-rw-r--r--Lib/packaging/command/build_py.py6
-rw-r--r--Lib/packaging/command/install_lib.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/packaging/command/build_py.py b/Lib/packaging/command/build_py.py
index 0eafffa..e5b10b0 100644
--- a/Lib/packaging/command/build_py.py
+++ b/Lib/packaging/command/build_py.py
@@ -1,6 +1,7 @@
"""Build pure Python modules (just copy to build directory)."""
import os
+import imp
import sys
from glob import glob
@@ -330,9 +331,10 @@ class build_py(Command, Mixin2to3):
outputs.append(filename)
if include_bytecode:
if self.compile:
- outputs.append(filename + "c")
+ outputs.append(imp.cache_from_source(filename))
if self.optimize > 0:
- outputs.append(filename + "o")
+ outputs.append(imp.cache_from_source(filename,
+ debug_override=False))
outputs += [
os.path.join(build_dir, filename)
diff --git a/Lib/packaging/command/install_lib.py b/Lib/packaging/command/install_lib.py
index 5e81b41..558966d 100644
--- a/Lib/packaging/command/install_lib.py
+++ b/Lib/packaging/command/install_lib.py
@@ -1,6 +1,7 @@
"""Install all modules (extensions and pure Python)."""
import os
+import imp
import sys
import logging
@@ -172,9 +173,10 @@ class install_lib(Command):
if ext != PYTHON_SOURCE_EXTENSION:
continue
if self.compile:
- bytecode_files.append(py_file + "c")
+ bytecode_files.append(imp.cache_from_source(py_file))
if self.optimize > 0:
- bytecode_files.append(py_file + "o")
+ bytecode_files.append(imp.cache_from_source(
+ py_file, debug_override=False))
return bytecode_files