1.1 --- a/common.py Thu Feb 02 23:42:08 2017 +0100
1.2 +++ b/common.py Fri Feb 03 23:24:15 2017 +0100
1.3 @@ -533,18 +533,19 @@
1.4
1.5 node = compiler.ast.Stmt([
1.6
1.7 - # <iterator> = {n.list}.__iter__
1.8 + # <next> = {n.list}.__iter__().next
1.9
1.10 compiler.ast.Assign(
1.11 [compiler.ast.AssName(self.get_iterator_name(), "OP_ASSIGN")],
1.12 - compiler.ast.CallFunc(
1.13 - compiler.ast.Getattr(n.list, "__iter__"),
1.14 - []
1.15 - )),
1.16 + compiler.ast.Getattr(
1.17 + compiler.ast.CallFunc(
1.18 + compiler.ast.Getattr(n.list, "__iter__"),
1.19 + []
1.20 + ), "next")),
1.21
1.22 # try:
1.23 # while True:
1.24 - # <var>... = <iterator>.next()
1.25 + # <var>... = <next>()
1.26 # ...
1.27 # except StopIteration:
1.28 # pass
1.29 @@ -556,7 +557,7 @@
1.30 compiler.ast.Assign(
1.31 [n.assign],
1.32 compiler.ast.CallFunc(
1.33 - compiler.ast.Getattr(compiler.ast.Name(self.get_iterator_name()), "next"),
1.34 + compiler.ast.Name(self.get_iterator_name()),
1.35 []
1.36 )),
1.37 n.body]),