summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2007-04-16 18:59:37 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2007-04-16 18:59:37 +0200
commit9f2d2fa0d07faee617acaa840809e8954fb64627 (patch)
treee401e974b5c6d2430bf6d184ef7913ca9649c220
parent0fd5b636cbbf9441f06a6aaba72768fc30c93c6d (diff)
downloadastroid-git-9f2d2fa0d07faee617acaa840809e8954fb64627.tar.gz
more infinite recursion fix
-rw-r--r--inference.py3
-rw-r--r--manager.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/inference.py b/inference.py
index 8c45c74f..b666b440 100644
--- a/inference.py
+++ b/inference.py
@@ -85,7 +85,8 @@ def infer_empty_node(self, context=None):
yield YES
else:
try:
- for infered in MANAGER.infer_astng_from_something(self.object):
+ for infered in MANAGER.infer_astng_from_something(self.object,
+ context=context):
yield infered
except ASTNGError:
yield YES
diff --git a/manager.py b/manager.py
index c757df8c..e4bfbfbf 100644
--- a/manager.py
+++ b/manager.py
@@ -186,7 +186,7 @@ class ASTNGManager(OptionsProviderMixIn):
return modastng.getattr(klass.__name__)[0] # XXX
- def infer_astng_from_something(self, obj, modname=None):
+ def infer_astng_from_something(self, obj, modname=None, context=None):
"""infer astng for the given class"""
if hasattr(obj, '__class__') and not isinstance(obj, type):
klass = obj.__class__
@@ -205,7 +205,7 @@ class ASTNGManager(OptionsProviderMixIn):
'Unable to get module for object %r' % obj)
# take care, on living object __module__ is regularly wrong :(
modastng = self.astng_from_module_name(modname)
- for infered in modastng.igetattr(name):
+ for infered in modastng.igetattr(name, context):
if klass is not obj and isinstance(infered, nodes.Class):
infered = Instance(infered)
yield infered