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); # unbound method objects instead of function objects);
# using keys() because apparently there are objects for which # using keys() because apparently there are objects for which
# __dict__ changes while getting attributes # __dict__ changes while getting attributes
obj_dict = self.get_attr(self.object, '__dict__') try:
members = [(mname, self.get_attr(self.object, mname, None)) obj_dict = self.get_attr(self.object, '__dict__')
for mname in obj_dict.keys()] 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) membernames = set(m[0] for m in members)
# add instance attributes from the analyzer # add instance attributes from the analyzer
if self.analyzer: if self.analyzer: