[Zope3-checkins] CVS: Zope3/src/pythonlib - __init__.py:1.2

Barry Warsaw barry@wooz.org
Fri, 11 Apr 2003 15:53:13 -0400


Update of /cvs-repository/Zope3/src/pythonlib
In directory cvs.zope.org:/tmp/cvs-serv18693

Modified Files:
	__init__.py 
Log Message:
If the module doesn't have an __all__, use dir(mod) filtering out any
names that start with underscore.


=== Zope3/src/pythonlib/__init__.py 1.1 => 1.2 ===
--- Zope3/src/pythonlib/__init__.py:1.1	Fri Apr 11 15:13:27 2003
+++ Zope3/src/pythonlib/__init__.py	Fri Apr 11 15:53:13 2003
@@ -27,5 +27,10 @@
     else:
         raise
 
-    for attr in mod.__all__:
+    try:
+        all = mod.__all__
+    except AttributeError:
+        all = [name for name in dir(mod) if not name.startswith('_')]
+
+    for attr in all:
         globals[attr] = getattr(mod, attr)