Commit 8211297a authored by Brett Cannon's avatar Brett Cannon

Fix a bad assumption that all objects assigned to '__loader__' on a module

will have a '_files' attribute.
parent 87fa5594
......@@ -37,7 +37,8 @@ def requires(resource, msg=None):
def find_package_modules(package, mask):
import fnmatch
if hasattr(package, "__loader__"):
if (hasattr(package, "__loader__") and
hasattr(package.__loader__, '_files')):
path = package.__name__.replace(".", os.path.sep)
mask = os.path.join(path, mask)
for fnm in package.__loader__._files.iterkeys():
......
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