diff options
author | Georg Brandl <georg@python.org> | 2011-01-08 18:44:06 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-01-08 18:44:06 +0100 |
commit | 0bdc1d30dfe8aa3751fdd1358939c65b59736b2c (patch) | |
tree | 448b8576265dc98fd08e0a95b8cd5f7e869faf47 /sphinx/ext/autodoc.py | |
parent | f5ecd62d05fa5502795e31ac5cc8778c570269cd (diff) | |
parent | 87dc9b302e4d3e03851b3d94ca2a86000280f99c (diff) | |
download | sphinx-git-0bdc1d30dfe8aa3751fdd1358939c65b59736b2c.tar.gz |
merge with https://bitbucket.org/langacore/sphinx
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 044a181f7..396841363 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -27,7 +27,8 @@ from sphinx.pycode import ModuleAnalyzer, PycodeError from sphinx.application import ExtensionError from sphinx.util.nodes import nested_parse_with_titles from sphinx.util.compat import Directive -from sphinx.util.inspect import isdescriptor, safe_getmembers, safe_getattr +from sphinx.util.inspect import getargspec, isdescriptor, safe_getmembers, \ + safe_getattr from sphinx.util.pycompat import base_exception, class_types from sphinx.util.docstrings import prepare_docstring @@ -902,15 +903,15 @@ class FunctionDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # cannot introspect arguments of a C function or method pass try: - argspec = inspect.getargspec(self.object) + argspec = getargspec(self.object) except TypeError: # if a class should be documented as function (yay duck # typing) we try to use the constructor signature as function # signature without the first argument. try: - argspec = inspect.getargspec(self.object.__new__) + argspec = getargspec(self.object.__new__) except TypeError: - argspec = inspect.getargspec(self.object.__init__) + argspec = getargspec(self.object.__init__) if argspec[0]: del argspec[0][0] args = inspect.formatargspec(*argspec) @@ -960,7 +961,7 @@ class ClassDocumenter(ModuleLevelDocumenter): (inspect.ismethod(initmeth) or inspect.isfunction(initmeth)): return None try: - argspec = inspect.getargspec(initmeth) + argspec = getargspec(initmeth) except TypeError: # still not possible: happens e.g. for old-style classes # with __init__ in C @@ -1117,7 +1118,7 @@ class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): inspect.ismethoddescriptor(self.object): # can never get arguments of a C function or method return None - argspec = inspect.getargspec(self.object) + argspec = getargspec(self.object) if argspec[0] and argspec[0][0] in ('cls', 'self'): del argspec[0][0] return inspect.formatargspec(*argspec) |