diff options
| author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-11-30 22:37:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-30 22:37:04 +0000 |
| commit | 8a45ca542a65ea27e7acaa44a4c833a27830e796 (patch) | |
| tree | 8cc5563159c3c11b88d0f9c9b9164ed21a9d9e7f /Doc/whatsnew | |
| parent | af8c8caaf5e07c02202d736a31f6a2f7e27819b8 (diff) | |
| download | cpython-git-8a45ca542a65ea27e7acaa44a4c833a27830e796.tar.gz | |
bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (GH-29780)
Diffstat (limited to 'Doc/whatsnew')
| -rw-r--r-- | Doc/whatsnew/3.11.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 8db26cd012..6853c04143 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -181,6 +181,12 @@ Other CPython Implementation Changes hash-based pyc files now use ``siphash13``, too. (Contributed by Inada Naoki in :issue:`29410`.) +* When an active exception is re-raised by a :keyword:`raise` statement with no parameters, + the traceback attached to this exception is now always ``sys.exc_info()[1].__traceback__``. + This means that changes made to the traceback in the current :keyword:`except` clause are + reflected in the re-raised exception. + (Contributed by Irit Katriel in :issue:`45711`.) + New Modules =========== @@ -266,6 +272,16 @@ sqlite3 (Contributed by Erlend E. Aasland in :issue:`45828`.) +sys +--- + +* :func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields + from the ``value`` (the exception instance), so when an exception is + modified while it is being handled, the changes are reflected in + the results of subsequent calls to :func:`exc_info`. + (Contributed by Irit Katriel in :issue:`45711`.) + + threading --------- @@ -579,6 +595,17 @@ New Features suspend and resume tracing and profiling. (Contributed by Victor Stinner in :issue:`43760`.) +* :c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` + arguments, the interpreter now derives those values from the exception + instance (the ``value`` argument). The function still steals references + of all three arguments. + (Contributed by Irit Katriel in :issue:`45711`.) + +* :c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` + fields of the result from the exception instance (the ``value`` field). + (Contributed by Irit Katriel in :issue:`45711`.) + + Porting to Python 3.11 ---------------------- |
