You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/gevent/tests/test__real_greenlet.py

30 lines
464 B

"""Testing that greenlet restores sys.exc_info.
Passes with CPython + greenlet 0.4.0
Fails with PyPy 2.2.1
"""
from __future__ import print_function
import sys
import greenlet
print('Your greenlet version: %s' % (getattr(greenlet, '__version__', None), ))
result = []
def func():
result.append(repr(sys.exc_info()))
g = greenlet.greenlet(func)
try:
1 / 0
except ZeroDivisionError:
g.switch()
assert result == ['(None, None, None)'], result