diff options
-rw-r--r-- | Lib/ctypes/test/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 2ae5405..2b745c2 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(): |