summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/install_lib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-07-28 14:55:10 (GMT)
committerFred Drake <fdrake@acm.org>2004-07-28 14:55:10 (GMT)
commit25d88926b94c5a101d0059b46084bb93989ffdf5 (patch)
tree703676fc4b42adf3e14ba4c82f9720dcdd520389 /Lib/distutils/command/install_lib.py
parent33ee76ae9ee9d0ad64f8e0a36bc711bab39bb11d (diff)
downloadcpython-25d88926b94c5a101d0059b46084bb93989ffdf5.zip
cpython-25d88926b94c5a101d0059b46084bb93989ffdf5.tar.gz
cpython-25d88926b94c5a101d0059b46084bb93989ffdf5.tar.bz2
Since build_py handles package data installation, the list of outputs
can contain more than just .py files. Make sure we only report bytecode files for the .py files.
Diffstat (limited to 'Lib/distutils/command/install_lib.py')
-rw-r--r--Lib/distutils/command/install_lib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
index daf3e01..c234117 100644
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -7,6 +7,11 @@ from types import IntType
from distutils.core import Command
from distutils.errors import DistutilsOptionError
+
+# Extension for Python source files.
+PYTHON_SOURCE_EXTENSION = os.extsep + "py"
+
+
class install_lib (Command):
description = "install all Python modules (extensions and pure Python)"
@@ -155,6 +160,12 @@ class install_lib (Command):
def _bytecode_filenames (self, py_filenames):
bytecode_files = []
for py_file in py_filenames:
+ # Since build_py handles package data installation, the
+ # list of outputs can contain more than just .py files.
+ # Make sure we only report bytecode for the .py files.
+ ext = os.path.splitext(os.path.normcase(py_file))[1]
+ if ext != PYTHON_SOURCE_EXTENSION:
+ continue
if self.compile:
bytecode_files.append(py_file + "c")
if self.optimize > 0: