diff options
author | Eevee (Alex Munroe) <amunroe@yelp.com> | 2014-03-24 16:09:34 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <amunroe@yelp.com> | 2014-07-01 17:33:00 -0700 |
commit | 2e13d989dbf9a097c679e4e1ca71e59fc9e5524f (patch) | |
tree | f7f8f96d3867f81d6155f77f8a670f92b2364be2 /protocols.py | |
parent | 2bf7e926b234bf8376a63f672380d2f1ae8eeb8d (diff) | |
download | astroid-git-2e13d989dbf9a097c679e4e1ca71e59fc9e5524f.tar.gz |
Remove context.lookupname; make it an argument to infer() when appropriate.
Diffstat (limited to 'protocols.py')
-rw-r--r-- | protocols.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/protocols.py b/protocols.py index 616340c9..f486e7cc 100644 --- a/protocols.py +++ b/protocols.py @@ -241,9 +241,8 @@ def _arguments_infer_argname(self, name, context): try: if context is None: context = InferenceContext() - with context.scope(lookupname=None): - for infered in self.default_value(name).infer(context): - yield infered + for infered in self.default_value(name).infer(context): + yield infered yield YES except NoDefault: yield YES @@ -253,12 +252,8 @@ def arguments_assigned_stmts(self, node, context, asspath=None): if context.callcontext: # reset call context/name callcontext = context.callcontext - with context.scope(callcontext=None, lookupname=None): - for infered in callcontext.infer_argument(self.parent, node.name, context): - yield infered - return - for infered in _arguments_infer_argname(self, node.name, context): - yield infered + return callcontext.infer_argument(self.parent, node.name, context) + return _arguments_infer_argname(self, node.name, context) nodes.Arguments.assigned_stmts = arguments_assigned_stmts |