Georg Brandl committed c711a39 Merge

merge with 0.6

  • Participants
  • Parent commits f057b3a, c7f1e36

Comments (0)

Files changed (6)

 Release 0.6.2 (in development)
+* Fix autodoc crash for objects without a ``__name__``.
+* Fix intersphinx for installations without urllib2.HTTPSHandler.
 * #134: Fix pending_xref leftover nodes when using the todolist
   directive from the todo extension.
 include babel.cfg
 include Makefile
 ... use Sphinx with SCons?
    Glenn Hutchings has written a SCons build script to build Sphinx
    documentation; it is hosted here:
+... convert from my existing docs using MoinMoin markup?
+   The easiest way is to convert to xhtml, then convert `xhtml to reST`_.  You'll
+   still need to mark up classes and such, but the headings and code examples
+   come through cleanly.
 .. _api role:
+.. _xhtml to reST:


             # __dict__ contains only the members directly defined in
             # the class (but get them via getattr anyway, to e.g. get
-            # unbound method objects instead of function objects)
+            # unbound method objects instead of function objects);
+            # using keys() because apparently there are objects for which
+            # __dict__ changes while getting attributes
             return False, sorted([
                 (mname, self.get_attr(self.object, mname))
-                for mname in self.get_attr(self.object, '__dict__')])
+                for mname in self.get_attr(self.object, '__dict__').keys()])
     def filter_members(self, members, want_all):
         # if the class is documented under another name, document it
         # as data/attribute
         if ret:
-            self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
+            if hasattr(self.object, '__name__'):
+                self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
+            else:
+                self.doc_as_attr = True
         return ret
     def format_args(self):


 if __name__ == '__main__':
-    main()
+    main(sys.argv)


+handlers = [urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
+            urllib2.HTTPHandler()]
+if hasattr(urllib2, 'HTTPSHandler'):
+    handlers.append(urllib2.HTTPSHandler)
-    urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
-    urllib2.HTTPHandler(), urllib2.HTTPSHandler()))
 def fetch_inventory(app, uri, inv):