diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-09-26 10:05:18 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-09-26 10:05:18 -0400 |
commit | 0de041b81f687f94391f7345f8164313723b93ef (patch) | |
tree | f3dae0095d0ca436ecf69f660d9a78be85b902f1 /setuptools/command/install_lib.py | |
parent | 8f5ca6ed5efe1523a511325a1d1c620ead832646 (diff) | |
download | python-setuptools-bitbucket-0de041b81f687f94391f7345f8164313723b93ef.tar.gz |
Generate the filenames more directly.
Diffstat (limited to 'setuptools/command/install_lib.py')
-rw-r--r-- | setuptools/command/install_lib.py | 26 |
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, |