Author: Armin Rigo <[email protected]>
Branch: release-2.1.x
Changeset: r65513:1c74480193aa
Date: 2013-07-19 20:44 +0200
http://bitbucket.org/pypy/pypy/changeset/1c74480193aa/
Log: Fix the second test.
diff --git a/lib_pypy/greenlet.py b/lib_pypy/greenlet.py
--- a/lib_pypy/greenlet.py
+++ b/lib_pypy/greenlet.py
@@ -57,6 +57,7 @@
def __switch(target, methodname, *baseargs):
current = getcurrent()
+ convert_greenletexit = True
#
while not (target.__main or _continulet.is_pending(target)):
# inlined __nonzero__ ^^^ in case it's overridden
@@ -75,6 +76,16 @@
# up the 'parent' explicitly. Good enough, because a Ctrl-C
# will show that the program is caught in this loop here.)
target = target.parent
+ # convert a "raise GreenletExit" into "return GreenletExit"
+ if methodname == 'throw' and convert_greenletexit:
+ try:
+ raise baseargs[0], baseargs[1]
+ except GreenletExit, e:
+ methodname = 'switch'
+ baseargs = (((e,), {}),)
+ except:
+ pass
+ convert_greenletexit = False
#
try:
unbound_method = getattr(_continulet, methodname)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit