[pypy-commit] pypy py3k: Some translation fixes

amauryfa noreply at buildbot.pypy.org
Thu May 31 14:38:48 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r55227:61b3803ec585
Date: 2012-05-31 14:36 +0200
http://bitbucket.org/pypy/pypy/changeset/61b3803ec585/

Log:	Some translation fixes

diff --git a/TODO b/TODO
--- a/TODO
+++ b/TODO
@@ -7,4 +7,6 @@
 
 re-enable IntDictStrategy
 
+re-enable StdObjSpace.listview_str
+
 unskip numpypy tests in module/test_lib_pypy/numpypy/
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -880,15 +880,18 @@
         raise BytecodeCorruption, "old opcode, no longer in use"
 
     def SETUP_LOOP(self, offsettoend, next_instr):
-        block = LoopBlock(self, next_instr + offsettoend, self.lastblock)
+        block = LoopBlock(self.valuestackdepth,
+                          next_instr + offsettoend, self.lastblock)
         self.lastblock = block
 
     def SETUP_EXCEPT(self, offsettoend, next_instr):
-        block = ExceptBlock(self, next_instr + offsettoend, self.lastblock)
+        block = ExceptBlock(self.valuestackdepth,
+                            next_instr + offsettoend, self.lastblock)
         self.lastblock = block
 
     def SETUP_FINALLY(self, offsettoend, next_instr):
-        block = FinallyBlock(self, next_instr + offsettoend, self.lastblock)
+        block = FinallyBlock(self.valuestackdepth,
+                             next_instr + offsettoend, self.lastblock)
         self.lastblock = block
 
     def SETUP_WITH(self, offsettoend, next_instr):
@@ -903,7 +906,8 @@
         w_exit = self.space.get(w_descr, w_manager)
         self.settopvalue(w_exit)
         w_result = self.space.get_and_call_function(w_enter, w_manager)
-        block = WithBlock(self, next_instr + offsettoend, self.lastblock)
+        block = WithBlock(self.valuestackdepth,
+                          next_instr + offsettoend, self.lastblock)
         self.lastblock = block
         self.pushvalue(w_result)
 
@@ -1244,9 +1248,9 @@
 
     _immutable_ = True
 
-    def __init__(self, frame, handlerposition, previous):
+    def __init__(self, valuestackdepth, handlerposition, previous):
         self.handlerposition = handlerposition
-        self.valuestackdepth = frame.valuestackdepth
+        self.valuestackdepth = valuestackdepth
         self.previous = previous   # this makes a linked list of blocks
 
     def __eq__(self, other):
@@ -1345,7 +1349,8 @@
             w_last_exception = W_OperationError(frame.last_exception)
             w_last_exception = frame.space.wrap(w_last_exception)
             frame.pushvalue(w_last_exception)
-            block = ExceptHandlerBlock(self, 0, frame.lastblock)
+            block = ExceptHandlerBlock(self.valuestackdepth,
+                                       0, frame.lastblock)
             frame.lastblock = block
         frame.pushvalue(frame.space.wrap(unroller))
         frame.pushvalue(operationerr.get_w_value(frame.space))
diff --git a/pypy/objspace/flow/flowcontext.py b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -430,7 +430,8 @@
         w_exit = self.space.getattr(w_manager, self.space.wrap("__exit__"))
         self.settopvalue(w_exit)
         w_result = self.space.call_method(w_manager, "__enter__")
-        block = WithBlock(self, next_instr + offsettoend, self.lastblock)
+        block = WithBlock(self.valuestackdepth,
+                          next_instr + offsettoend, self.lastblock)
         self.lastblock = block
         self.pushvalue(w_result)
 
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -453,7 +453,7 @@
             raise self._wrap_expected_length(expected_length, len(t))
         return t
 
-    def listview_str(self, w_obj):
+    def __disabled_listview_str(self, w_obj):
         # note: uses exact type checking for objects with strategies,
         # and isinstance() for others.  See test_listobject.test_uses_custom...
         if type(w_obj) is W_ListObject:


More information about the pypy-commit mailing list