mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Restore 2.4 compatibility and fix removing the generated file properly.
This commit is contained in:
parent
ef98b65f29
commit
1878c02078
@ -853,7 +853,12 @@ class ClassDocumenter(ModuleLevelDocumenter):
|
||||
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)
|
||||
|
@ -470,9 +470,10 @@ class Class(Base):
|
||||
#: 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üß"""
|
||||
|
@ -31,8 +31,7 @@ from sphinx.writers.latex import LaTeXTranslator
|
||||
|
||||
|
||||
def teardown_module():
|
||||
(test_root / '_build').rmtree()
|
||||
(test_root / 'generated').rmtree()
|
||||
(test_root / '_build').rmtree(True)
|
||||
|
||||
|
||||
html_warnfile = StringIO()
|
||||
|
@ -26,7 +26,6 @@ def setup_module():
|
||||
|
||||
def teardown_module():
|
||||
app.cleanup()
|
||||
(test_root / 'generated').rmtree()
|
||||
|
||||
def warning_emitted(file, text):
|
||||
for warning in warnings:
|
||||
|
@ -11,10 +11,6 @@
|
||||
|
||||
from util import *
|
||||
|
||||
def teardown_module():
|
||||
(test_root / '_build').rmtree()
|
||||
(test_root / 'generated').rmtree()
|
||||
|
||||
|
||||
@with_app(confoverrides={'language': 'de'})
|
||||
def test_i18n(app):
|
||||
|
@ -16,10 +16,6 @@ from util import *
|
||||
|
||||
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'})
|
||||
|
@ -105,7 +105,7 @@ class TestApp(application.Sphinx):
|
||||
|
||||
application.CONFIG_FILENAME = confname
|
||||
|
||||
self.cleanup_trees = []
|
||||
self.cleanup_trees = [test_root / 'generated']
|
||||
|
||||
if srcdir is None:
|
||||
srcdir = test_root
|
||||
|
Loading…
Reference in New Issue
Block a user