[pypy-commit] pypy unpickle-coroutine-trampoline: support the CALL_METHOD bytecode too

cfbolz noreply at buildbot.pypy.org
Fri May 13 14:31:56 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: unpickle-coroutine-trampoline
Changeset: r44120:6ba23d163e2c
Date: 2011-05-13 14:40 +0200
http://bitbucket.org/pypy/pypy/changeset/6ba23d163e2c/

Log:	support the CALL_METHOD bytecode too

diff --git a/pypy/module/_stackless/interp_coroutine.py b/pypy/module/_stackless/interp_coroutine.py
--- a/pypy/module/_stackless/interp_coroutine.py
+++ b/pypy/module/_stackless/interp_coroutine.py
@@ -390,7 +390,8 @@
         nargs = oparg & 0xff
         nkwds = (oparg >> 8) & 0xff
         if space.config.objspace.opcodes.CALL_METHOD and opcode == map['CALL_METHOD']:
-            raise NotImplementedError
+            if nkwds == 0:     # only positional arguments
+                frame.dropvalues(nargs + 2)
         elif opcode == map['CALL_FUNCTION']:
             if nkwds == 0:     # only positional arguments
                 frame.dropvalues(nargs + 1)
diff --git a/pypy/module/_stackless/test/test_pickle.py b/pypy/module/_stackless/test/test_pickle.py
--- a/pypy/module/_stackless/test/test_pickle.py
+++ b/pypy/module/_stackless/test/test_pickle.py
@@ -19,7 +19,7 @@
 class AppTestPickle:
 
     def setup_class(cls):
-        cls.space = gettestobjspace(usemodules=('_stackless',))
+        cls.space = gettestobjspace(usemodules=('_stackless',), CALL_METHOD=True)
 
     def test_pickle_coroutine_empty(self):
         # this test is limited to basic pickling.


More information about the pypy-commit mailing list