From f12991c93e450178787ddcbc53f70e2bf4e154fa Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 4 Apr 2010 18:52:29 +0200 Subject: [PATCH] #362: In autodoc, check for the existence of ``__self__`` on function objects before accessing it. --- CHANGES | 3 +++ sphinx/ext/autodoc.py | 1 + 2 files changed, 4 insertions(+) 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