[Python-checkins] r52945 - python/trunk/Lib/ctypes/test/__init__.py

brett.cannon python-checkins at python.org
Thu Dec 7 00:38:49 CET 2006


Author: brett.cannon
Date: Thu Dec  7 00:38:48 2006
New Revision: 52945

Modified:
   python/trunk/Lib/ctypes/test/__init__.py
Log:
Fix a bad assumption that all objects assigned to '__loader__' on a module
will have a '_files' attribute.


Modified: python/trunk/Lib/ctypes/test/__init__.py
==============================================================================
--- python/trunk/Lib/ctypes/test/__init__.py	(original)
+++ python/trunk/Lib/ctypes/test/__init__.py	Thu Dec  7 00:38:48 2006
@@ -37,7 +37,8 @@
 
 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():


More information about the Python-checkins mailing list