Commits

Anonymous committed 47edd43

- Results from '__all__' introspection override parsing when the latter fails,
such as when the list is an expression result.

Comments (0)

Files changed (3)

epydoc/src/epydoc/apidoc.py

         elif value_type == 'other':
             return [var_doc for var_doc in var_list
                     if not isinstance(var_doc.value,
-                                      (ClassDoc, RoutineDoc))]
+                                      (ClassDoc, RoutineDoc, ModuleDoc))]
         else:
             raise ValueError('Bad value type %r' % value_type)
 

epydoc/src/epydoc/docintrospecter.py

     else:
         module_doc.is_package = False
 
-    # Record the module's __all__ attribute (public names).
-    if hasattr(module, '__all__'):
-        try:
-            public_names = set([str(name) for name in module.__all__])
-            for name, var_doc in module_doc.variables.items():
-                if name in public_names:
-                    var_doc.is_public = True
-                    if not isinstance(var_doc, ModuleDoc):
-                        var_doc.is_imported = False
-                else:
-                    var_doc.is_public = False
-        except KeyboardInterrupt, SystemExit: raise
-        except: pass
-
     # Make sure we have a name for the package.
     dotted_name = module_doc.canonical_name
     if dotted_name is UNKNOWN:
 
         module_doc.variables[child_name] = child_var_doc
 
+    # Record the module's __all__ attribute (public names).
+    if hasattr(module, '__all__'):
+        try:
+            public_names = set([str(name) for name in module.__all__])
+            for name, var_doc in module_doc.variables.items():
+                if name in public_names:
+                    var_doc.is_public = True
+                    if not isinstance(var_doc, ModuleDoc):
+                        var_doc.is_imported = False
+                else:
+                    var_doc.is_public = False
+        except KeyboardInterrupt, SystemExit: raise
+        except: pass
+
     return module_doc
 
 #////////////////////////////////////////////////////////////

epydoc/src/epydoc/docparser.py

                 else:
                     var_doc.is_public = False
         except ParseError:
-            pass # [xx]
+            # If we couldn't parse the list, give precedence to introspection.
+            for name, var_doc in module_doc.variables.items():
+                if not isinstance(var_doc, ModuleDoc):
+                    var_doc.is_imported = UNKNOWN
         del module_doc.variables['__all__']
 
     # If __path__ is defined, then extract its value (pkgs only)