[issue2542] PyErr_ExceptionMatches must not fail
Daniel Diniz
report at bugs.python.org
Thu Apr 3 17:51:15 CEST 2008
Daniel Diniz <ajaksu2 at users.sourceforge.net> added the comment:
The tests pass and prints the ignores. But I still see an issue:
import sys
def g():
try:
return g()
except:
return sys.exc_info()
>>> g()
(<type 'exceptions.RuntimeError'>, 'maximum recursion depth exceeded
while calling a Python object', <traceback object at 0xb7d3d75c>)
>>> import sys
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: maximum recursion depth exceeded
Then, I can raise that RuntimeError and clear things:
>>> sys.excepthook(*g())
Traceback (most recent call last):
File "<stdin>", line 3, in g
RuntimeError: maximum recursion depth exceeded while calling a Python object
>>> import sys
>>>
The attached patch adds a test for this condition, I hope someone more
test-savvy than I can review it.
----------
nosy: +ajaksu2
Added file: http://bugs.python.org/file9932/test_exceptions.diff
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2542>
__________________________________
More information about the Python-bugs-list
mailing list