Commit 8a4809f7 authored by Jason R. Coombs's avatar Jason R. Coombs

Perform the inclusion filter after traversal for congruency with exclude

parent 2b13fb2c
...@@ -63,9 +63,10 @@ def find_packages(where='.', exclude=(), include=('*',)): ...@@ -63,9 +63,10 @@ def find_packages(where='.', exclude=(), include=('*',)):
) )
if looks_like_package: if looks_like_package:
pkg_name = prefix + name pkg_name = prefix + name
if any(fnmatchcase(pkg_name, pat) for pat in include): out.append(pkg_name)
out.append(pkg_name) stack.append((fn, pkg_name + '.'))
stack.append((fn, pkg_name + '.')) for pat in include:
out = [item for item in out if fnmatchcase(item,pat)]
for pat in exclude: for pat in exclude:
out = [item for item in out if not fnmatchcase(item,pat)] out = [item for item in out if not fnmatchcase(item,pat)]
return out return out
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment