summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-12-06 23:38:48 (GMT)
committerBrett Cannon <bcannon@gmail.com>2006-12-06 23:38:48 (GMT)
commit8211297a7e4d18833b61170f65a1c47183e348c8 (patch)
tree7820ddc454797c9c2c696fd22d4d6b576c2f4118 /Lib
parent87fa5594790fda836c8a59708de60513430c0328 (diff)
downloadcpython-8211297a7e4d18833b61170f65a1c47183e348c8.zip
cpython-8211297a7e4d18833b61170f65a1c47183e348c8.tar.gz
cpython-8211297a7e4d18833b61170f65a1c47183e348c8.tar.bz2
Fix a bad assumption that all objects assigned to '__loader__' on a module
will have a '_files' attribute.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/__init__.py3
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():