Ticket #228 (closed defect: fixed)
Exceptions get lost inside except blocks when shadowed by exceptions raised by Cython
| Reported by: | scoder | Owned by: | scoder |
|---|---|---|---|
| Priority: | major | Milestone: | 0.12 |
| Component: | Code Generation | Keywords: | |
| Cc: |
Description (last modified by scoder) (diff)
This change
http://hg.cython.org/cython-devel/rev/24bb0456d787
breaks this code:
>>> try: ... raise ValueError ... except: ... print(sys.exc_info()[0] is ValueError or sys.exc_info()[0]) ... a = list(py_iterator()) ... print(sys.exc_info()[0] is ValueError or sys.exc_info()[0]) ... a = list(cy_iterator()) ... print(sys.exc_info()[0] is ValueError or sys.exc_info()[0]) True True True
The ValueError gets lost after the list(cy_iterator()) line, which raises a StopIteration that is caught by Python's list building code. The output of this doctest is
True True None
which is clearly unexpected.
Change History
Note: See
TracTickets for help on using
tickets.
