]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102192: use PyErr_SetHandledException instead of the legacy PyErr_SetExcInfo ...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Sat, 1 Apr 2023 05:01:48 +0000 (06:01 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Apr 2023 05:01:48 +0000 (10:31 +0530)
Python/bytecodes.c
Python/generated_cases.c.h

index 825fa705a4cd380233be45e60d3aac3e76c8f921..617b6f311e2f7704f9a9384add334d9f541eb250 100644 (file)
@@ -1842,7 +1842,7 @@ dummy_func(
             ERROR_IF(match == NULL, error);
 
             if (!Py_IsNone(match)) {
-                PyErr_SetExcInfo(NULL, Py_NewRef(match), NULL);
+                PyErr_SetHandledException(match);
             }
         }
 
index 6bb37d69cc0740b9bd319f9d14b04d195f7b41cd..7df585be0bef50ef06e75444b9d2e56a0bd14406 100644 (file)
             if (match == NULL) goto pop_2_error;
 
             if (!Py_IsNone(match)) {
-                PyErr_SetExcInfo(NULL, Py_NewRef(match), NULL);
+                PyErr_SetHandledException(match);
             }
             #line 2597 "Python/generated_cases.c.h"
             stack_pointer[-1] = match;