Commits

Georg Brandl committed dd18222

Restore 2.4 compatibility and fix removing the generated file properly.

  • Participants
  • Parent commits 3b4406a

Comments (0)

Files changed (7)

sphinx/ext/autodoc.py

         if initmeth is None or initmeth is object.__init__ or not \
                (inspect.ismethod(initmeth) or inspect.isfunction(initmeth)):
             return None
-        argspec = inspect.getargspec(initmeth)
+        try:
+            argspec = inspect.getargspec(initmeth)
+        except TypeError:
+            # still not possible: happens e.g. for old-style classes
+            # with __init__ in C
+            return None
         if argspec[0] and argspec[0][0] in ('cls', 'self'):
             del argspec[0][0]
         return inspect.formatargspec(*argspec)

tests/test_autodoc.py

     #: should be documented -- süß
     attr = 'bar'
 
-    @property
     def prop(self):
         """Property."""
+    # stay 2.4 compatible (docstring!)
+    prop = property(prop, doc="Property.")
 
     docattr = 'baz'
     """should likewise be documented -- süß"""

tests/test_build.py

 
 
 def teardown_module():
-    (test_root / '_build').rmtree()
-    (test_root / 'generated').rmtree()
+    (test_root / '_build').rmtree(True)
 
 
 html_warnfile = StringIO()

tests/test_env.py

 
 def teardown_module():
     app.cleanup()
-    (test_root / 'generated').rmtree()
 
 def warning_emitted(file, text):
     for warning in warnings:

tests/test_i18n.py

 
 from util import *
 
-def teardown_module():
-    (test_root / '_build').rmtree()
-    (test_root / 'generated').rmtree()
-
 
 @with_app(confoverrides={'language': 'de'})
 def test_i18n(app):

tests/test_theming.py

 
 from sphinx.theming import Theme, ThemeError
 
-def teardown_module():
-    (test_root / '_build').rmtree()
-    (test_root / 'generated').rmtree()
-
 
 @with_app(confoverrides={'html_theme': 'ziptheme',
                          'html_theme_options.testopt': 'foo'})
 
         application.CONFIG_FILENAME = confname
 
-        self.cleanup_trees = []
+        self.cleanup_trees = [test_root / 'generated']
 
         if srcdir is None:
             srcdir = test_root