Implements the Distutils 'build_py' command."""
import sys, os
-import sys
+import imp
from glob import glob
from distutils.core import 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)
(install all Python modules)."""
import os
+import imp
import sys
from distutils.core import 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