More fixes for PEP 3147 compliance in distutils (#11254)

This commit is contained in:
Éric Araujo 2011-11-03 03:45:33 +01:00
parent 5df1108de2
commit c465b2f843
5 changed files with 94 additions and 59 deletions

View file

@ -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