File fix-trashcan.patch of Package failed_python-traits
*** Begin Patch
*** Update File: traits-6.4.3/traits/ctraits.c
@@
#include <Python.h>
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Provide compatibility for Python versions which removed the deprecated
+ Py_TRASHCAN_SAFE_BEGIN / Py_TRASHCAN_SAFE_END macros (e.g. Python 3.13).
+ If the *_SAFE variants are not available, fall back to the older
+ Py_TRASHCAN_BEGIN / Py_TRASHCAN_END macros (these are available on
+ the Python versions where the safe macros were removed).
+*/
+#ifndef Py_TRASHCAN_SAFE_BEGIN
+# ifdef Py_TRASHCAN_BEGIN
+# define Py_TRASHCAN_SAFE_BEGIN(op) Py_TRASHCAN_BEGIN(op)
+# else
+/* If none of the trashcan macros are available, define no-op fallbacks
+ to keep compilation going (this is safer than failing the build). */
+# define Py_TRASHCAN_SAFE_BEGIN(op) (void)0
+# endif
+#endif
+
+#ifndef Py_TRASHCAN_SAFE_END
+# ifdef Py_TRASHCAN_END
+# define Py_TRASHCAN_SAFE_END(op) Py_TRASHCAN_END(op)
+# else
+# define Py_TRASHCAN_SAFE_END(op) (void)0
+# endif
+#endif
+
*** End Patch