Author: Ronny Pfannschmidt <[email protected]>
Branch:
Changeset: r45086:af74db5394fb
Date: 2011-06-23 18:28 +0200
http://bitbucket.org/pypy/pypy/changeset/af74db5394fb/
Log: add a test for the greenlet sys.exc_info save/restore behaviour
which is wrong on cpythons greenlet
diff --git a/pypy/module/_stackless/test/test_greenlet.py
b/pypy/module/_stackless/test/test_greenlet.py
--- a/pypy/module/_stackless/test/test_greenlet.py
+++ b/pypy/module/_stackless/test/test_greenlet.py
@@ -72,6 +72,23 @@
g1 = greenlet(f)
raises(ValueError, g2.switch)
+
+ def test_exc_info_save_restore(self):
+ from _stackless import greenlet
+ import sys
+ def f():
+ try:
+ raise ValueError('fun')
+ except:
+ exc_info = sys.exc_info()
+ greenlet(h).switch()
+ assert exc_info == sys.exc_info()
+
+ def h():
+ assert sys.exc_info() == (None, None, None)
+
+ greenlet(f).switch()
+
def test_exception(self):
from _stackless import greenlet
import sys
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit