summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-02-21 23:20:26 +0100
committerGeorg Brandl <georg@python.org>2010-02-21 23:20:26 +0100
commitcee7e4ba3bcf34aab0c41f0172ade87952fefbf1 (patch)
tree4abf0a2814396cb786fbb3ca7e384c2e8147bbc4 /sphinx/ext/autodoc.py
parentfab92b215afa61ffa17a12919a3bd5192adba754 (diff)
parent686824997dffd30b689f0abc5f3df8997149acc4 (diff)
downloadsphinx-git-cee7e4ba3bcf34aab0c41f0172ade87952fefbf1.tar.gz
merge with 0.6
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 81c3f6a44..1be4a7059 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -377,7 +377,12 @@ class Documenter(object):
args = "(%s)" % self.args
else:
# try to introspect the signature
- args = self.format_args()
+ try:
+ args = self.format_args()
+ except Exception, err:
+ self.directive.warn('error while formatting arguments for '
+ '%s: %s' % (self.fullname, err))
+ args = None
retann = self.retann
@@ -663,12 +668,7 @@ class Documenter(object):
self.add_line(u'', '')
# format the object's signature, if any
- try:
- sig = self.format_signature()
- except Exception, err:
- self.directive.warn('error while formatting signature for '
- '%s: %s' % (self.fullname, err))
- sig = ''
+ sig = self.format_signature()
# generate the directive header and options, if applicable
self.add_directive_header(sig)
@@ -868,7 +868,6 @@ class ClassDocumenter(ModuleLevelDocumenter):
return ret
def format_args(self):
- args = None
# for classes, the relevant signature is the __init__ method's
initmeth = self.get_attr(self.object, '__init__', None)
# classes without __init__ method, default __init__ or