Issue #13307: fix bdist_rpm test failures
This commit is contained in:
commit
ef297a8a35
|
@ -3,7 +3,7 @@
|
||||||
Implements the Distutils 'build_py' command."""
|
Implements the Distutils 'build_py' command."""
|
||||||
|
|
||||||
import sys, os
|
import sys, os
|
||||||
import sys
|
import imp
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
|
@ -311,9 +311,9 @@ class build_py (Command):
|
||||||
outputs.append(filename)
|
outputs.append(filename)
|
||||||
if include_bytecode:
|
if include_bytecode:
|
||||||
if self.compile:
|
if self.compile:
|
||||||
outputs.append(filename + "c")
|
outputs.append(imp.cache_from_source(filename, True))
|
||||||
if self.optimize > 0:
|
if self.optimize > 0:
|
||||||
outputs.append(filename + "o")
|
outputs.append(imp.cache_from_source(filename, False))
|
||||||
|
|
||||||
outputs += [
|
outputs += [
|
||||||
os.path.join(build_dir, filename)
|
os.path.join(build_dir, filename)
|
||||||
|
|
|
@ -4,6 +4,7 @@ Implements the Distutils 'install_lib' command
|
||||||
(install all Python modules)."""
|
(install all Python modules)."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import imp
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
|
@ -164,9 +165,9 @@ class install_lib(Command):
|
||||||
if ext != PYTHON_SOURCE_EXTENSION:
|
if ext != PYTHON_SOURCE_EXTENSION:
|
||||||
continue
|
continue
|
||||||
if self.compile:
|
if self.compile:
|
||||||
bytecode_files.append(py_file + "c")
|
bytecode_files.append(imp.cache_from_source(py_file, True))
|
||||||
if self.optimize > 0:
|
if self.optimize > 0:
|
||||||
bytecode_files.append(py_file + "o")
|
bytecode_files.append(imp.cache_from_source(py_file, False))
|
||||||
|
|
||||||
return bytecode_files
|
return bytecode_files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue