Browse Source

py_compat: Add PyUnstable_Object_IsUniquelyReferenced

rdb 3 months ago
parent
commit
d1f4be7305
1 changed files with 6 additions and 0 deletions
  1. 6 0
      dtool/src/interrogatedb/py_compat.h

+ 6 - 0
dtool/src/interrogatedb/py_compat.h

@@ -368,6 +368,12 @@ PyDict_GetItemStringRef(PyObject *mp, const char *key, PyObject **result) {
 #  define Py_END_CRITICAL_SECTION2() }
 #  define Py_END_CRITICAL_SECTION2() }
 #endif
 #endif
 
 
+/* Python 3.14 */
+
+#if PY_VERSION_HEX < 0x030E00A8
+#  define PyUnstable_Object_IsUniquelyReferenced(op) (Py_REFCNT((op)) == 1)
+#endif
+
 /* Other Python implementations */
 /* Other Python implementations */
 
 
 #endif  // HAVE_PYTHON
 #endif  // HAVE_PYTHON