mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
autosummary: fix python2.4 compatibility
This commit is contained in:
parent
3eb57cdf19
commit
2bf065f664
@ -128,6 +128,14 @@ def autosummary_table_visit_html(self, node):
|
|||||||
|
|
||||||
# -- autodoc integration -------------------------------------------------------
|
# -- autodoc integration -------------------------------------------------------
|
||||||
|
|
||||||
|
try:
|
||||||
|
ismemberdescriptor = inspect.ismemberdescriptor
|
||||||
|
isgetsetdescriptor = inspect.isgetsetdescriptor
|
||||||
|
except AttributeError:
|
||||||
|
def ismemberdescriptor(obj):
|
||||||
|
return False
|
||||||
|
isgetsetdescriptor = ismemberdescriptor
|
||||||
|
|
||||||
def get_documenter(obj):
|
def get_documenter(obj):
|
||||||
"""
|
"""
|
||||||
Get an autodoc.Documenter class suitable for documenting the given object
|
Get an autodoc.Documenter class suitable for documenting the given object
|
||||||
@ -142,7 +150,7 @@ def get_documenter(obj):
|
|||||||
return autodoc.ModuleDocumenter
|
return autodoc.ModuleDocumenter
|
||||||
elif inspect.ismethod(obj) or inspect.ismethoddescriptor(obj):
|
elif inspect.ismethod(obj) or inspect.ismethoddescriptor(obj):
|
||||||
return autodoc.MethodDocumenter
|
return autodoc.MethodDocumenter
|
||||||
elif (inspect.ismemberdescriptor(obj) or inspect.isgetsetdescriptor(obj)
|
elif (ismemberdescriptor(obj) or isgetsetdescriptor(obj)
|
||||||
or inspect.isdatadescriptor(obj)):
|
or inspect.isdatadescriptor(obj)):
|
||||||
return autodoc.AttributeDocumenter
|
return autodoc.AttributeDocumenter
|
||||||
elif inspect.isroutine(obj):
|
elif inspect.isroutine(obj):
|
||||||
|
Loading…
Reference in New Issue
Block a user