Skip to content

Commit

Permalink
Avoid recursively inferring the same attr on the same class. Closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
eevee committed Apr 8, 2014
1 parent 23dbb7c commit 2d7a87b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def getattr(self, name, context=None, lookupclass=True):
def igetattr(self, name, context=None):
"""inferred getattr"""
try:
# avoid recursively inferring the same attr on the same class
if context:
context.push((self._proxied, name))
# XXX frame should be self._proxied, or not ?
get_attr = self.getattr(name, context, lookupclass=False)
return _infer_stmts(self._wrap_attr(get_attr, context), context,
Expand Down

0 comments on commit 2d7a87b

Please sign in to comment.