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 \
|
if initmeth is None or initmeth is object.__init__ or not \
|
||||||
(inspect.ismethod(initmeth) or inspect.isfunction(initmeth)):
|
(inspect.ismethod(initmeth) or inspect.isfunction(initmeth)):
|
||||||
return None
|
return None
|
||||||
|
try:
|
||||||
argspec = inspect.getargspec(initmeth)
|
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'):
|
if argspec[0] and argspec[0][0] in ('cls', 'self'):
|
||||||
del argspec[0][0]
|
del argspec[0][0]
|
||||||
return inspect.formatargspec(*argspec)
|
return inspect.formatargspec(*argspec)
|
||||||
|
@ -470,9 +470,10 @@ class Class(Base):
|
|||||||
#: should be documented -- süß
|
#: should be documented -- süß
|
||||||
attr = 'bar'
|
attr = 'bar'
|
||||||
|
|
||||||
@property
|
|
||||||
def prop(self):
|
def prop(self):
|
||||||
"""Property."""
|
"""Property."""
|
||||||
|
# stay 2.4 compatible (docstring!)
|
||||||
|
prop = property(prop, doc="Property.")
|
||||||
|
|
||||||
docattr = 'baz'
|
docattr = 'baz'
|
||||||
"""should likewise be documented -- süß"""
|
"""should likewise be documented -- süß"""
|
||||||
|
@ -31,8 +31,7 @@ from sphinx.writers.latex import LaTeXTranslator
|
|||||||
|
|
||||||
|
|
||||||
def teardown_module():
|
def teardown_module():
|
||||||
(test_root / '_build').rmtree()
|
(test_root / '_build').rmtree(True)
|
||||||
(test_root / 'generated').rmtree()
|
|
||||||
|
|
||||||
|
|
||||||
html_warnfile = StringIO()
|
html_warnfile = StringIO()
|
||||||
|
@ -26,7 +26,6 @@ def setup_module():
|
|||||||
|
|
||||||
def teardown_module():
|
def teardown_module():
|
||||||
app.cleanup()
|
app.cleanup()
|
||||||
(test_root / 'generated').rmtree()
|
|
||||||
|
|
||||||
def warning_emitted(file, text):
|
def warning_emitted(file, text):
|
||||||
for warning in warnings:
|
for warning in warnings:
|
||||||
|
@ -11,10 +11,6 @@
|
|||||||
|
|
||||||
from util import *
|
from util import *
|
||||||
|
|
||||||
def teardown_module():
|
|
||||||
(test_root / '_build').rmtree()
|
|
||||||
(test_root / 'generated').rmtree()
|
|
||||||
|
|
||||||
|
|
||||||
@with_app(confoverrides={'language': 'de'})
|
@with_app(confoverrides={'language': 'de'})
|
||||||
def test_i18n(app):
|
def test_i18n(app):
|
||||||
|
@ -16,10 +16,6 @@ from util import *
|
|||||||
|
|
||||||
from sphinx.theming import Theme, ThemeError
|
from sphinx.theming import Theme, ThemeError
|
||||||
|
|
||||||
def teardown_module():
|
|
||||||
(test_root / '_build').rmtree()
|
|
||||||
(test_root / 'generated').rmtree()
|
|
||||||
|
|
||||||
|
|
||||||
@with_app(confoverrides={'html_theme': 'ziptheme',
|
@with_app(confoverrides={'html_theme': 'ziptheme',
|
||||||
'html_theme_options.testopt': 'foo'})
|
'html_theme_options.testopt': 'foo'})
|
||||||
|
@ -105,7 +105,7 @@ class TestApp(application.Sphinx):
|
|||||||
|
|
||||||
application.CONFIG_FILENAME = confname
|
application.CONFIG_FILENAME = confname
|
||||||
|
|
||||||
self.cleanup_trees = []
|
self.cleanup_trees = [test_root / 'generated']
|
||||||
|
|
||||||
if srcdir is None:
|
if srcdir is None:
|
||||||
srcdir = test_root
|
srcdir = test_root
|
||||||
|
Loading…
Reference in New Issue
Block a user