aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/install_lib.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-09-26 10:05:18 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-09-26 10:05:18 -0400
commit4e5bbb8e5175b35f8cbaace630bd0dd3091d6946 (patch)
tree6137ca536560de9385289c8e653b08d7b729eb2d /setuptools/command/install_lib.py
parenta7dbe706890eab7ba330c51ea59349c28080dfde (diff)
downloadexternal_python_setuptools-4e5bbb8e5175b35f8cbaace630bd0dd3091d6946.tar.gz
external_python_setuptools-4e5bbb8e5175b35f8cbaace630bd0dd3091d6946.tar.bz2
external_python_setuptools-4e5bbb8e5175b35f8cbaace630bd0dd3091d6946.zip
Generate the filenames more directly.
Diffstat (limited to 'setuptools/command/install_lib.py')
-rw-r--r--setuptools/command/install_lib.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py
index 259f0899..3f39d945 100644
--- a/setuptools/command/install_lib.py
+++ b/setuptools/command/install_lib.py
@@ -29,22 +29,18 @@ class install_lib(orig.install_lib):
@staticmethod
def _gen_exclude_names():
"""
- Generate the list of file paths to be excluded for namespace
- packages (bytecode cache files).
+ Generate file paths to be excluded for namespace packages (bytecode
+ cache files).
"""
- exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo']
- if hasattr(imp, 'get_tag'):
- exclude_names.extend((
- os.path.join(
- '__pycache__',
- '__init__.' + imp.get_tag() + '.pyc'
- ),
- os.path.join(
- '__pycache__',
- '__init__.' + imp.get_tag() + '.pyo'
- ),
- ))
- return exclude_names
+ yield '__init__.py'
+ yield '__init__.pyc'
+ yield '__init__.pyo'
+
+ if not hasattr(imp, 'get_tag'):
+ return
+
+ yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyc')
+ yield os.path.join('__pycache__', '__init__.' + imp.get_tag() + '.pyo')
def copy_tree(
self, infile, outfile,