diff options
| author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-03-07 09:41:40 +0100 |
|---|---|---|
| committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-03-07 09:41:40 +0100 |
| commit | 15267a0623a1bc798add06154fb5bf874c067a36 (patch) | |
| tree | 762e8265a7fa8be2eceb193a5a6709799a3c09d5 /inference.py | |
| parent | 78222e4d6cd7d9f73721d9ef72f836c24149acad (diff) | |
| download | astroid-git-15267a0623a1bc798add06154fb5bf874c067a36.tar.gz | |
fix #3651: crash when callable as defaut arg
Diffstat (limited to 'inference.py')
| -rw-r--r-- | inference.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/inference.py b/inference.py index 68874550..95ec202c 100644 --- a/inference.py +++ b/inference.py @@ -191,9 +191,11 @@ def infer_function(self, context=None): return if context.callcontext: # reset call context/name - for infered in context.callcontext.infer_argument(self, name, context): - yield infered + callcontext = context.callcontext + context = copy_context(context) context.callcontext = None + for infered in callcontext.infer_argument(self, name, context): + yield infered return # Function.argnames can be None in astng (means that we don't have # information on argnames), in which case we can't do anything more @@ -217,6 +219,7 @@ def infer_function(self, context=None): # if there is a default value, yield it. And then yield YES to reflect # we can't guess given argument value try: + context = copy_context(context) for infered in self.default_value(name).infer(context): yield infered yield YES |
