]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #13307: fix bdist_rpm test failures
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 3 Nov 2011 01:45:46 +0000 (02:45 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 3 Nov 2011 01:45:46 +0000 (02:45 +0100)
Lib/distutils/command/build_py.py
Lib/distutils/command/install_lib.py

index 3868c12f5b7dad9f85985e7afbcf9755c636e043..9e2473fbb618550f6dfc2ed71040de7eb53b5b5f 100644 (file)
@@ -3,7 +3,7 @@
 Implements the Distutils 'build_py' command."""
 
 import sys, os
-import sys
+import imp
 from glob import glob
 
 from distutils.core import Command
@@ -311,9 +311,9 @@ class build_py (Command):
             outputs.append(filename)
             if include_bytecode:
                 if self.compile:
-                    outputs.append(filename + "c")
+                    outputs.append(imp.cache_from_source(filename, True))
                 if self.optimize > 0:
-                    outputs.append(filename + "o")
+                    outputs.append(imp.cache_from_source(filename, False))
 
         outputs += [
             os.path.join(build_dir, filename)
index 3d01d07115682690479571d74b539e9c301458c0..8a6bc7dec4a7b851931327e59f6ed2c77d35210e 100644 (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,9 @@ 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, True))
             if self.optimize > 0:
-                bytecode_files.append(py_file + "o")
+                bytecode_files.append(imp.cache_from_source(py_file, False))
 
         return bytecode_files