diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-02 14:00:19 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-09-02 14:00:19 -0400 |
| commit | 053ed7e2f6885b001a85fc0a8759f2226a2f178a (patch) | |
| tree | 5479a67aeeb20f03c3b65e9e9404997f917a8a03 /setuptools/__init__.py | |
| parent | 396a217ad725e25c8761edf3678dea349d06e023 (diff) | |
| download | python-setuptools-git-053ed7e2f6885b001a85fc0a8759f2226a2f178a.tar.gz | |
Refactor for clarity
Diffstat (limited to 'setuptools/__init__.py')
| -rw-r--r-- | setuptools/__init__.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py index b048d9fd..2eb51a1f 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -41,10 +41,14 @@ def find_packages(where='.', exclude=()): where,prefix = stack.pop(0) for name in os.listdir(where): fn = os.path.join(where,name) - if ('.' not in name and os.path.isdir(fn) and - os.path.isfile(os.path.join(fn,'__init__.py')) - ): - out.append(prefix+name); stack.append((fn,prefix+name+'.')) + looks_like_package = ( + '.' not in name + and os.path.isdir(fn) + and os.path.isfile(os.path.join(fn,'__init__.py')) + ) + if looks_like_package: + out.append(prefix+name) + stack.append((fn,prefix+name+'.')) for pat in list(exclude)+['ez_setup']: from fnmatch import fnmatchcase out = [item for item in out if not fnmatchcase(item,pat)] |
