summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-04-04 18:52:29 +0200
committerGeorg Brandl <georg@python.org>2010-04-04 18:52:29 +0200
commitf12991c93e450178787ddcbc53f70e2bf4e154fa (patch)
treef88988dfe55c871ea786bc72f09a2169226cfda2 /sphinx/ext/autodoc.py
parente8fe8584e468d9eee33b9d640bae27b6a8b0e605 (diff)
downloadsphinx-git-f12991c93e450178787ddcbc53f70e2bf4e154fa.tar.gz
#362: In autodoc, check for the existence of ``__self__`` on function objects before accessing it.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 9f91154fb..676740671 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -982,6 +982,7 @@ class MethodDocumenter(ClassLevelDocumenter):
self.member_order = self.member_order - 1
elif isinstance(self.object, FunctionType) or \
(isinstance(self.object, BuiltinFunctionType) and
+ hasattr(self.object, '__self__') and
self.object.__self__ is not None):
self.directivetype = 'staticmethod'
# document class and static members before ordinary ones