[pypy-commit] pypy py3.5: fix translation

rlamy pypy.commits at gmail.com
Tue Nov 1 11:41:52 EDT 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r88034:6dd9cf87c0a7
Date: 2016-11-01 15:41 +0000
http://bitbucket.org/pypy/pypy/changeset/6dd9cf87c0a7/

Log:	fix translation

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
@@ -578,7 +578,7 @@
         self.pop_frame_block(F_BLOCK_LOOP, start)
         self.visit_sequence(fr.orelse)
         self.use_next_block(end)
-    
+
     def visit_AsyncFor(self, fr):
         self.update_position(fr.lineno, True)
         b_try = self.new_block()
@@ -588,21 +588,21 @@
         b_try_cleanup = self.new_block()
         b_after_loop = self.new_block()
         b_after_loop_else = self.new_block()
-        
+
         self.emit_jump(ops.SETUP_LOOP, b_after_loop)
         self.push_frame_block(F_BLOCK_LOOP, b_try)
-        
+
         fr.iter.walkabout(self)
         self.emit_op(ops.GET_AITER)
         self.load_const(self.space.w_None)
         self.emit_op(ops.YIELD_FROM)
-        
+
         self.use_next_block(b_try)
         # This adds another line, so each for iteration can be traced.
         self.lineno_set = False
         self.emit_jump(ops.SETUP_EXCEPT, b_except)
         self.push_frame_block(F_BLOCK_EXCEPT, b_try)
-        
+
         self.emit_op(ops.GET_ANEXT)
         self.load_const(self.space.w_None)
         self.emit_op(ops.YIELD_FROM)
@@ -610,13 +610,13 @@
         self.emit_op(ops.POP_BLOCK)
         self.pop_frame_block(F_BLOCK_EXCEPT, b_try)
         self.emit_jump(ops.JUMP_FORWARD, b_after_try)
-        
+
         self.use_next_block(b_except)
         self.emit_op(ops.DUP_TOP)
         self.emit_op_name(ops.LOAD_GLOBAL, self.names, "StopAsyncIteration")
         self.emit_op_arg(ops.COMPARE_OP, 10)
         self.emit_jump(ops.POP_JUMP_IF_FALSE, b_try_cleanup, True)
-        
+
         self.emit_op(ops.POP_TOP)
         self.emit_op(ops.POP_TOP)
         self.emit_op(ops.POP_TOP)
@@ -630,23 +630,23 @@
         self.emit_op(ops.POP_TOP)
         self.emit_op(ops.POP_BLOCK) # for SETUP_LOOP
         self.emit_jump(ops.JUMP_ABSOLUTE, b_after_loop_else, True)
-        
+
         self.use_next_block(b_try_cleanup)
         self.emit_op(ops.END_FINALLY)
-        
+
         self.use_next_block(b_after_try)
         self.visit_sequence(fr.body)
         self.emit_jump(ops.JUMP_ABSOLUTE, b_try, True)
-        
+
         self.emit_op(ops.POP_BLOCK) # for SETUP_LOOP
         self.pop_frame_block(F_BLOCK_LOOP, b_try)
-        
+
         self.use_next_block(b_after_loop)
         self.emit_jump(ops.JUMP_ABSOLUTE, b_end, True)
-        
+
         self.use_next_block(b_after_loop_else)
         self.visit_sequence(fr.orelse)
-        
+
         self.use_next_block(b_end)
 
     def visit_While(self, wh):
@@ -701,7 +701,7 @@
             self.emit_op(ops.POP_TOP)
             if handler.name:
                 ## generate the equivalent of:
-                ## 
+                ##
                 ## try:
                 ##     # body
                 ## except type as name:
@@ -960,7 +960,7 @@
 
     def visit_AsyncWith(self, wih):
         self.update_position(wih.lineno, True)
-        self.handle_asyncwithitem(wih, 0, is_async=True)
+        self.handle_withitem(wih, 0, is_async=True)
 
     def visit_Raise(self, rais):
         self.update_position(rais.lineno, True)
@@ -1008,7 +1008,7 @@
         self.emit_op(ops.GET_YIELD_FROM_ITER)
         self.load_const(self.space.w_None)
         self.emit_op(ops.YIELD_FROM)
-    
+
     def visit_Await(self, aw):
         self.update_position(aw.lineno)
         aw.value.walkabout(self)
@@ -1147,7 +1147,7 @@
             self.emit_op_arg(outer_op, elt_subitems)
         else:
             self.emit_op_arg(single_op, seen_star)
-    
+
     def _visit_assignment(self, node, elts, ctx):
         elt_count = len(elts) if elts else 0
         if ctx == ast.Store:
@@ -1230,7 +1230,7 @@
             self.emit_op_arg(ops.BUILD_MAP_UNPACK, oparg)
             containers -= (oparg - 1)
             is_unpacking = False
-    
+
     def visit_Set(self, s):
         self._visit_starunpack(s, s.elts, ops.BUILD_SET, ops.BUILD_SET, ops.BUILD_SET_UNPACK)
 
@@ -1286,7 +1286,7 @@
                     # If we ended up with more than one stararg, we need
                     # to concatenate them into a single sequence.
                     self.emit_op_arg(ops.BUILD_LIST_UNPACK, nsubargs)
-        
+
         # Repeat procedure for keyword args
         nseen = 0 # the number of keyword arguments on the stack following
         if keywords is not None:
@@ -1340,7 +1340,7 @@
             return
         call.func.walkabout(self)
         self._make_call(0, call.args, call.keywords)
-    
+
     def _call_has_no_star_args(self, call):
         if call.args is not None:
             for elt in call.args:


More information about the pypy-commit mailing list