classification
Title: Chaining exceptions at C level
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: benjamin.peterson, pitrou, python-dev, serhiy.storchaka, stutzbach
Priority: normal Keywords: patch

Created on 2014-06-11 06:15 by serhiy.storchaka, last changed 2014-10-08 20:01 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
capi_chain_exceptions.patch serhiy.storchaka, 2014-07-04 17:30 review
Messages (6)
msg220236 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-06-11 06:15
The proposed patch introduces new private function which chains previously fetched and current exceptions. This will help in correct implementing at C level an equivalent of following Python idioms:

    try:
        ...
    finally:
        ...

and

    try:
        ...
    except:
        ...
        raise
msg221918 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-06-29 23:31
Hm, looks like you forgot to upload a patch!
msg222296 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-07-04 17:30
Sorry. Here is it.
msg222339 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-07-05 06:49
I added 3.4 because this private function makes cleaner and more bug-free existing code (mostly recently added) and possible future bug fixes. Note a bug just fixed by Benjamin (changeset 888fd1cdec6f).
msg228813 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-08 19:34
New changeset 9af21752ea2a by Serhiy Storchaka in branch '3.4':
Issue #21715: Extracted shared complicated code in the _io module to new
https://hg.python.org/cpython/rev/9af21752ea2a

New changeset 8b1ac1a3d007 by Serhiy Storchaka in branch 'default':
Issue #21715: Extracted shared complicated code in the _io module to new
https://hg.python.org/cpython/rev/8b1ac1a3d007
msg228815 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-08 20:01
Thank you for the review Antoine.
History
Date User Action Args
2014-10-08 20:01:30serhiy.storchakasetstatus: open -> closed
versions: + Python 3.4
messages: + msg228815

assignee: serhiy.storchaka
resolution: fixed
stage: patch review -> resolved
2014-10-08 19:34:31python-devsetnosy: + python-dev
messages: + msg228813
2014-07-05 06:49:23serhiy.storchakasetmessages: + msg222339
2014-07-05 00:33:19pitrousetversions: - Python 3.4
2014-07-04 17:30:42serhiy.storchakasetfiles: + capi_chain_exceptions.patch
keywords: + patch
messages: + msg222296
2014-06-29 23:31:48pitrousetmessages: + msg221918
2014-06-11 06:15:47serhiy.storchakacreate