summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-03-16 23:46:58 +0100
committerGeorg Brandl <georg@python.org>2009-03-16 23:46:58 +0100
commit1878c02078fe9cfb34020df8fc30f920c37d997d (patch)
treea7ffd7e4dd1ab45808d1107fe20a27a1e8a5a642 /sphinx/ext/autodoc.py
parentef98b65f29a3eaf0a56c7414514b03f35edd1356 (diff)
downloadsphinx-git-1878c02078fe9cfb34020df8fc30f920c37d997d.tar.gz
Restore 2.4 compatibility and fix removing the generated file properly.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 5c1a06530..72d500297 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -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)