diff --git a/CHANGES b/CHANGES index 2a09999d9..0eaea73c1 100644 --- a/CHANGES +++ b/CHANGES @@ -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. 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