#362: In autodoc, check for the existence of `__self__` on function objects before accessing it.

This commit is contained in:
Georg Brandl 2010-04-04 18:52:29 +02:00
parent e8fe8584e4
commit f12991c93e
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,9 @@
Release 0.6.6 (in development)
==============================
* #362: In autodoc, check for the existence of ``__self__`` on
function objects before accessing it.
* #353: Strip leading and trailing whitespace when extracting
search words in the search function.

View File

@ -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