[Python-checkins] cpython (merge 3.2 -> default): Issue #13307: fix bdist_rpm test failures

antoine.pitrou python-checkins at python.org
Thu Nov 3 02:51:12 CET 2011


http://hg.python.org/cpython/rev/eb2991f7cdc8
changeset:   73314:eb2991f7cdc8
parent:      73312:ab11a6a73683
parent:      73313:2c0253d4d9ba
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Thu Nov 03 02:46:52 2011 +0100
summary:
  Issue #13307: fix bdist_rpm test failures

files:
  Lib/distutils/command/build_py.py    |  6 +++---
  Lib/distutils/command/install_lib.py |  5 +++--
  2 files changed, 6 insertions(+), 5 deletions(-)


diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
--- 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 sys, os
-import sys
+import imp
 from glob import glob
 
 from distutils.core import Command
@@ -311,9 +311,9 @@
             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)
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -4,6 +4,7 @@
 (install all Python modules)."""
 
 import os
+import imp
 import sys
 
 from distutils.core import Command
@@ -164,9 +165,9 @@
             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
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list