diff options
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)] |
