mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Merge follow-up for #11254 and other changes from 3.2
This commit is contained in:
commit
e64052176d
10 changed files with 133 additions and 88 deletions
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
Implements the Distutils 'build_py' command."""
|
||||
|
||||
import sys, os
|
||||
import os
|
||||
import imp
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
|
|
@ -311,9 +312,11 @@ class build_py (Command):
|
|||
outputs.append(filename)
|
||||
if include_bytecode:
|
||||
if self.compile:
|
||||
outputs.append(filename + "c")
|
||||
outputs.append(imp.cache_from_source(filename,
|
||||
debug_override=True))
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ Implements the Distutils 'install_lib' command
|
|||
(install all Python modules)."""
|
||||
|
||||
import os
|
||||
import imp
|
||||
import sys
|
||||
|
||||
from distutils.core import Command
|
||||
|
|
@ -164,9 +165,11 @@ 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, debug_override=True))
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue