hasattr checks working now, #408

This commit is contained in:
Dave Halter
2014-06-10 16:08:32 +02:00
parent bba120d906
commit 63868feb5d
3 changed files with 41 additions and 10 deletions

View File

@@ -48,11 +48,12 @@ class NameFinder(object):
if not names and not types \
and not (isinstance(self.name_str, pr.NamePart)
and isinstance(self.name_str.parent.parent, pr.Param)):
if not isinstance(self.name_str, (str, unicode)): # TODO Remove
if not isinstance(self.name_str, (str, unicode)): # TODO Remove?
err_type = 'name-error' if search_global else 'attribute-error'
message = ('AttributeError: %s has no attribute %s'
% (self._last_filter_name_scope, self.name_str))
analysis.add(self._evaluator, err_type, self.name_str, message)
analysis.add(self._evaluator, err_type, self.name_str, message,
payload=(self.scope, self.name_str))
debug.dbg('finder._names_to_types: %s -> %s', names, types)
return self._resolve_descriptors(types)