import itertools
import gc
import contextlib
+import sys
class BadStr(str):
self.assertEqual(expected, meth(*args1, **kwargs))
self.assertEqual(expected, wrapped(*args, **kwargs))
+ @unittest.skipIf(
+ hasattr(sys, 'getobjects'),
+ "Limited API is not compatible with Py_TRACE_REFS")
def test_vectorcall_limited(self):
from _testcapi import pyobject_vectorcall
obj = _testcapi.LimitedVectorCallClass()
+#include "pyconfig.h" // Py_TRACE_REFS
+
+#ifdef Py_TRACE_REFS
+
+// Py_TRACE_REFS is incompatible with Limited API
+#include "parts.h"
+int
+_PyTestCapi_Init_VectorcallLimited(PyObject *m) {
+ return 0;
+}
+
+#else
+
#define Py_LIMITED_API 0x030c0000 // 3.12
#include "parts.h"
#include "structmember.h" // PyMemberDef
return 0;
}
+
+#endif // Py_TRACE_REFS