From 6c77b126cf275d1cd92d8565d695b31d0d153020 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Fri, 31 Mar 2023 23:59:27 +0100 Subject: [PATCH] gh-102192: use PyErr_SetHandledException instead of the legacy PyErr_SetExcInfo --- Python/bytecodes.c | 2 +- Python/generated_cases.c.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 825fa705a4cd38..617b6f311e2f77 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -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); } } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 6bb37d69cc0740..7df585be0bef50 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2591,7 +2591,7 @@ 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;