python-cffi/py313-use-format-unraisable.patch
Dirk Mueller fec30ea192 - add py313-compat.patch
py313-use-format-unraisable.patch
  py313-use-hashpointer.patch: add upstream patches for py3.13
  support

  testsuite failures with Python 3.11
  * Revert "grovel: detect :float and :double in the :auto type"
  * no upstream changelog provided
  * no upstream changelog provided
 * CPython 3 on Windows: we again try to compile with Py_LIMITED_API by default
- Update pytest in spec to add c directory tests in addition to
    messages.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cffi?expand=0&rev=97
2024-06-30 21:27:50 +00:00

31 lines
986 B
Diff

From 49127c6929bfc7186fbfd3819dd5e058ad888de4 Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
Date: Thu, 16 Nov 2023 17:26:12 +0100
Subject: [PATCH] Use PyErr_FormatUnraisable() on Python 3.13 (#34)
Use the new public PyErr_FormatUnraisable() on Python 3.13.
The private _PyErr_WriteUnraisableMsg() function was removed in
Python 3.13:
https://github.com/python/cpython/pull/111643
---
src/c/_cffi_backend.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c
index 76ed8f09..5e284e00 100644
--- a/src/c/_cffi_backend.c
+++ b/src/c/_cffi_backend.c
@@ -6118,7 +6118,11 @@ static void _my_PyErr_WriteUnraisable(PyObject *t, PyObject *v, PyObject *tb,
PyErr_Restore(t, v, tb);
if (s != NULL) {
+#if PY_VERSION_HEX >= 0x030D0000
+ PyErr_FormatUnraisable("Exception ignored %S", s);
+#else
_PyErr_WriteUnraisableMsg(PyText_AS_UTF8(s), NULL);
+#endif
Py_DECREF(s);
}
else