New submission from Irit Katriel <iritkatr...@gmail.com>:

This behavior (that the OSError has the ValueError as context) should be tested 
and documented: 


>>> try:
...   raise TypeError(1)
... except:
...   raise ValueError(2)
... finally:
...   raise OSError(3)
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
ValueError: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
OSError: 3

----------
components: Interpreter Core
messages: 412003
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Add tests and documentation regarding context of exception in a finally 
block
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46563>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to