[pypy-commit] pypy stacklet: Fix for (at least) asmgcc translations.
arigo
noreply at buildbot.pypy.org
Thu Aug 18 10:44:29 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch: stacklet
Changeset: r46595:904e865cd899
Date: 2011-08-18 10:47 +0200
http://bitbucket.org/pypy/pypy/changeset/904e865cd899/
Log: Fix for (at least) asmgcc translations.
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
@@ -30,7 +30,7 @@
return ec
def descr_init(self, w_callable, __args__):
- if self.h:
+ if self.h != get_null_handle(self.space.config):
raise geterror(self.space, "continuation already __init__ialized")
sthread = self.build_sthread()
start_state.origin = self
@@ -45,7 +45,7 @@
raise getmemoryerror(self.space)
def descr_switch(self, w_value=None):
- if not self.h:
+ if self.h == get_null_handle(self.space.config):
raise geterror(self.space, "continuation not initialized yet")
if self.sthread.is_empty_handle(self.h):
raise geterror(self.space, "continuation already finished")
@@ -68,7 +68,8 @@
return w_value
def descr_is_pending(self):
- valid = bool(self.h) and not self.sthread.is_empty_handle(self.h)
+ valid = (self.h != get_null_handle(self.space.config)
+ and not self.sthread.is_empty_handle(self.h))
return self.space.newbool(valid)
More information about the pypy-commit
mailing list