[pypy-commit] pypy py3.5: Fix visit_tuple

raffael_t pypy.commits at gmail.com
Thu Jun 16 16:43:50 EDT 2016


Author: Raffael Tfirst <raffael.tfirst at gmail.com>
Branch: py3.5
Changeset: r85201:d3a8be3eee83
Date: 2016-06-16 22:42 +0200
http://bitbucket.org/pypy/pypy/changeset/d3a8be3eee83/

Log:	Fix visit_tuple

diff --git a/pypy/interpreter/astcompiler/codegen.py b/pypy/interpreter/astcompiler/codegen.py
--- a/pypy/interpreter/astcompiler/codegen.py
+++ b/pypy/interpreter/astcompiler/codegen.py
@@ -1072,7 +1072,12 @@
 
     def visit_Tuple(self, tup):
         self.update_position(tup.lineno)
-        self._visit_list_or_tuple(tup, tup.elts, tup.ctx, ops.BUILD_TUPLE)
+        if l.ctx == ast.Store:
+            self._visit_list_or_tuple_assignment(l, l.elts)
+        elif l.ctx == ast.Load:
+            self._visit_list_or_tuple_starunpack(tup, tup.elts, tup.ctx, ops.BUILD_TUPLE)
+        else
+            self.visit_sequence(l.elts)
 
     def visit_List(self, l):
         self.update_position(l.lineno)


More information about the pypy-commit mailing list