diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2000-05-13 02:11:10 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2000-05-13 02:11:10 (GMT) |
commit | 11fb783fa4b5760c0b5d528ba3ba6c7e25d8ae8b (patch) | |
tree | 7049401b8cc488ddaaa13e0bdfefa205e907757f /Lib/distutils/command/install_lib.py | |
parent | f9ebf98725841879d4b3f6aa59c385d0e87cd652 (diff) | |
download | cpython-11fb783fa4b5760c0b5d528ba3ba6c7e25d8ae8b.zip cpython-11fb783fa4b5760c0b5d528ba3ba6c7e25d8ae8b.tar.gz cpython-11fb783fa4b5760c0b5d528ba3ba6c7e25d8ae8b.tar.bz2 |
Added '_bytecode_filenames()' method, and use it in 'get_outputs()'
to ensure that compiled bytecode files are considered part of the output
of the "install_lib" command.
Diffstat (limited to 'Lib/distutils/command/install_lib.py')
-rw-r--r-- | Lib/distutils/command/install_lib.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py index 2d0a719..63c7a6b 100644 --- a/Lib/distutils/command/install_lib.py +++ b/Lib/distutils/command/install_lib.py @@ -72,8 +72,6 @@ class install_lib (Command): skip_msg = "byte-compilation of %s skipped" % f self.make_file (f, out_fn, compile, (f,), compile_msg, skip_msg) - - # run () @@ -94,6 +92,14 @@ class install_lib (Command): return outputs # _mutate_outputs () + + def _bytecode_filenames (self, py_filenames): + bytecode_files = [] + for py_file in py_filenames: + bytecode = py_file + (__debug__ and "c" or "o") + bytecode_files.append(bytecode) + + return bytecode_files def get_outputs (self): """Return the list of files that would be installed if this command @@ -104,14 +110,17 @@ class install_lib (Command): self._mutate_outputs (self.distribution.has_pure_modules(), 'build_py', 'build_lib', self.install_dir) - + if self.compile: + bytecode_outputs = self._bytecode_filenames(pure_outputs) + else: + bytecode_outputs = [] ext_outputs = \ self._mutate_outputs (self.distribution.has_ext_modules(), 'build_ext', 'build_lib', self.install_dir) - return pure_outputs + ext_outputs + return pure_outputs + bytecode_outputs + ext_outputs # get_outputs () |