From 8211297a7e4d18833b61170f65a1c47183e348c8 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 6 Dec 2006 23:38:48 +0000 Subject: [PATCH] Fix a bad assumption that all objects assigned to '__loader__' on a module will have a '_files' attribute. --- Lib/ctypes/test/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 2ae54052d17..2b745c206ef 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():