Fixes #836: catch AttributeError when retrieving __dict__ attribute.

This commit is contained in:
Georg Brandl 2012-03-10 21:11:07 +01:00
parent 7ecc658c71
commit fae8a17026

View File

@ -512,9 +512,13 @@ class Documenter(object):
# unbound method objects instead of function objects);
# using keys() because apparently there are objects for which
# __dict__ changes while getting attributes
obj_dict = self.get_attr(self.object, '__dict__')
members = [(mname, self.get_attr(self.object, mname, None))
for mname in obj_dict.keys()]
try:
obj_dict = self.get_attr(self.object, '__dict__')
except AttributeError:
members = []
else:
members = [(mname, self.get_attr(self.object, mname, None))
for mname in obj_dict.keys()]
membernames = set(m[0] for m in members)
# add instance attributes from the analyzer
if self.analyzer: