diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-23 10:11:47 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-23 10:11:47 -0500 |
commit | 2050af11f662a28f9c2c834552c195d90a5ac73e (patch) | |
tree | 6edb5559071b7bf907daa53c7e60839bf68652c5 /setuptools/command/build_ext.py | |
parent | 0b538cb95cbaf496897fcffb3c67a217d56f2511 (diff) | |
download | external_python_setuptools-2050af11f662a28f9c2c834552c195d90a5ac73e.tar.gz external_python_setuptools-2050af11f662a28f9c2c834552c195d90a5ac73e.tar.bz2 external_python_setuptools-2050af11f662a28f9c2c834552c195d90a5ac73e.zip |
Rewrite function to use extend and a generator expression.
Diffstat (limited to 'setuptools/command/build_ext.py')
-rw-r--r-- | setuptools/command/build_ext.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/setuptools/command/build_ext.py b/setuptools/command/build_ext.py index 414ad166..b5c2738c 100644 --- a/setuptools/command/build_ext.py +++ b/setuptools/command/build_ext.py @@ -197,14 +197,13 @@ class build_ext(_build_ext): def get_outputs(self): outputs = _build_ext.get_outputs(self) - optimize = self.get_finalized_command('build_py').optimize + fn_exts = ['.py', '.pyc'] + if self.get_finalized_command('build_py').optimize: + fn_exts.append('.pyo') ns_ext = (ext for ext in self.extensions if ext._needs_stub) for ext in ns_ext: base = os.path.join(self.build_lib, *ext._full_name.split('.')) - outputs.append(base + '.py') - outputs.append(base + '.pyc') - if optimize: - outputs.append(base + '.pyo') + outputs.extend(base + fnext for fnext in fn_exts) return outputs def write_stub(self, output_dir, ext, compile=False): |