summaryrefslogtreecommitdiff
path: root/protocols.py
diff options
context:
space:
mode:
authorJulien Cristau <julien.cristau@logilab.fr>2013-06-20 15:45:35 +0200
committerJulien Cristau <julien.cristau@logilab.fr>2013-06-20 15:45:35 +0200
commitf816bceffc7c43c049773223f94b776961fd3e78 (patch)
treea325fe54a04100b89d99e66c32f59826df27114f /protocols.py
parent3630cf510922ef1afd15ecf00bbf6e82adcd41b4 (diff)
downloadastroid-git-f816bceffc7c43c049773223f94b776961fd3e78.tar.gz
Handle python3.3's With nodes
Change With nodes to have a list of (expr, var) items as in python 3.3's ast.
Diffstat (limited to 'protocols.py')
-rw-r--r--protocols.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols.py b/protocols.py
index 1f4f15a6..a26986cb 100644
--- a/protocols.py
+++ b/protocols.py
@@ -310,10 +310,11 @@ nodes.ExceptHandler.assigned_stmts = raise_if_nothing_infered(excepthandler_assi
def with_assigned_stmts(self, node, context=None, asspath=None):
if asspath is None:
- for lst in self.vars.infer(context):
- if isinstance(lst, (nodes.Tuple, nodes.List)):
- for item in lst.nodes:
- yield item
+ for _, vars in self.items:
+ for lst in vars.infer(context):
+ if isinstance(lst, (nodes.Tuple, nodes.List)):
+ for item in lst.nodes:
+ yield item
nodes.With.assigned_stmts = raise_if_nothing_infered(with_assigned_stmts)