
https://github.com/cython/cython/pull/5690 https://github.com/cython/cython/pull/5725 Both are merged in cython 3.0.3, however that release breaks scipy.
50 lines
1.7 KiB
Diff
50 lines
1.7 KiB
Diff
Taken from https://github.com/cython/cython/pull/5725
|
|
|
|
From c38b320764bd2a7c089b332e0a3d27ec87b725d1 Mon Sep 17 00:00:00 2001
|
|
From: yut23 <yut23@gvljohnsons.com>
|
|
Date: Mon, 25 Sep 2023 16:34:50 -0400
|
|
Subject: [PATCH 1/2] Release references to traceback objects in Python 3.12+
|
|
|
|
Fixes: #5724
|
|
---
|
|
Cython/Utility/Exceptions.c | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/Cython/Utility/Exceptions.c b/Cython/Utility/Exceptions.c
|
|
index 20dc7faf3a8..a4416462500 100644
|
|
--- a/Cython/Utility/Exceptions.c
|
|
+++ b/Cython/Utility/Exceptions.c
|
|
@@ -190,6 +190,8 @@ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObjec
|
|
tmp_value = tstate->current_exception;
|
|
tstate->current_exception = value;
|
|
Py_XDECREF(tmp_value);
|
|
+ Py_XDECREF(tb);
|
|
+ Py_XDECREF(type);
|
|
#else
|
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
tmp_type = tstate->curexc_type;
|
|
|
|
From d8b71ef8ccb5ef114a77ce499f192f121060ca02 Mon Sep 17 00:00:00 2001
|
|
From: scoder <stefan_ml@behnel.de>
|
|
Date: Tue, 26 Sep 2023 11:08:24 +0200
|
|
Subject: [PATCH 2/2] Remove now-unused "unused" marker.
|
|
|
|
---
|
|
Cython/Utility/Exceptions.c | 3 +--
|
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
diff --git a/Cython/Utility/Exceptions.c b/Cython/Utility/Exceptions.c
|
|
index a4416462500..2144594ba53 100644
|
|
--- a/Cython/Utility/Exceptions.c
|
|
+++ b/Cython/Utility/Exceptions.c
|
|
@@ -190,8 +189,8 @@ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObjec
|
|
tmp_value = tstate->current_exception;
|
|
tstate->current_exception = value;
|
|
Py_XDECREF(tmp_value);
|
|
- Py_XDECREF(tb);
|
|
Py_XDECREF(type);
|
|
+ Py_XDECREF(tb);
|
|
#else
|
|
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
tmp_type = tstate->curexc_type;
|