Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: kill-someobject
Changeset: r58012:f346535f69fa
Date: 2012-10-11 10:05 +0200
http://bitbucket.org/pypy/pypy/changeset/f346535f69fa/

Log:    fix continuation

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -811,7 +811,7 @@
         interpreter class (a subclass of Wrappable).
         """
         assert RequiredClass is not None
-        if can_be_None and self.is_w(w_obj, self.w_None):
+        if can_be_None and self.is_none(w_obj):
             return None
         obj = self.interpclass_w(w_obj)
         if not isinstance(obj, RequiredClass):   # or obj is None
diff --git a/pypy/module/_collections/interp_deque.py 
b/pypy/module/_collections/interp_deque.py
--- a/pypy/module/_collections/interp_deque.py
+++ b/pypy/module/_collections/interp_deque.py
@@ -82,7 +82,7 @@
 
     def init(self, w_iterable=None, w_maxlen=None):
         space = self.space
-        if space.is_w(w_maxlen, space.w_None):
+        if space.is_none(w_maxlen):
             maxlen = sys.maxint
         else:
             maxlen = space.gateway_nonnegint_w(w_maxlen)
diff --git a/pypy/module/_continuation/interp_continuation.py 
b/pypy/module/_continuation/interp_continuation.py
--- a/pypy/module/_continuation/interp_continuation.py
+++ b/pypy/module/_continuation/interp_continuation.py
@@ -4,7 +4,7 @@
 from pypy.interpreter.executioncontext import ExecutionContext
 from pypy.interpreter.baseobjspace import Wrappable
 from pypy.interpreter.typedef import TypeDef
-from pypy.interpreter.gateway import interp2app
+from pypy.interpreter.gateway import interp2app, unwrap_spec, W_Root
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.pyframe import PyFrame
 
@@ -90,16 +90,21 @@
         h = sthread.switch(global_state.destination.h)
         return post_switch(sthread, h)
 
+    @unwrap_spec(w_value = (W_Root, 'space.w_None'),
+                 w_to = (W_Root, 'space.w_None'))
     def descr_switch(self, w_value=None, w_to=None):
         global_state.w_value = w_value
         return self.switch(w_to)
 
+    @unwrap_spec(w_val = (W_Root, 'space.w_None'),
+                 w_tb = (W_Root, 'space.w_None'),
+                 w_to = (W_Root, 'space.w_None'))
     def descr_throw(self, w_type, w_val=None, w_tb=None, w_to=None):
         from pypy.interpreter.pytraceback import check_traceback
         space = self.space
         #
         msg = "throw() third argument must be a traceback object"
-        if space.is_w(w_tb, space.w_None):
+        if space.is_none(w_tb):
             tb = None
         else:
             tb = check_traceback(space, w_tb, msg)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to