From: Brett Cannon Date: Wed, 6 Dec 2006 23:38:48 +0000 (+0000) Subject: Fix a bad assumption that all objects assigned to '__loader__' on a module X-Git-Tag: v2.6a1~2388 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8211297a7e4d18833b61170f65a1c47183e348c8;p=python Fix a bad assumption that all objects assigned to '__loader__' on a module will have a '_files' attribute. --- diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 2ae54052d1..2b745c206e 100644 --- a/Lib/ctypes/test/__init__.py +++ b/Lib/ctypes/test/__init__.py @@ -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():