File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 9
9
import itertools
10
10
import gc
11
11
import contextlib
12
+ import sys
12
13
13
14
14
15
class BadStr (str ):
@@ -759,6 +760,9 @@ def __call__(self, *args):
759
760
self .assertEqual (expected , meth (* args1 , ** kwargs ))
760
761
self .assertEqual (expected , wrapped (* args , ** kwargs ))
761
762
763
+ @unittest .skipIf (
764
+ hasattr (sys , 'getobjects' ),
765
+ "Limited API is not compatible with Py_TRACE_REFS" )
762
766
def test_vectorcall_limited (self ):
763
767
from _testcapi import pyobject_vectorcall
764
768
obj = _testcapi .LimitedVectorCallClass ()
Original file line number Diff line number Diff line change
1
+ #include "pyconfig.h" // Py_TRACE_REFS
2
+
3
+ #ifdef Py_TRACE_REFS
4
+
5
+ // Py_TRACE_REFS is incompatible with Limited API
6
+ #include "parts.h"
7
+ int
8
+ _PyTestCapi_Init_VectorcallLimited (PyObject * m ) {
9
+ return 0 ;
10
+ }
11
+
12
+ #else
13
+
1
14
#define Py_LIMITED_API 0x030c0000 // 3.12
2
15
#include "parts.h"
3
16
#include "structmember.h" // PyMemberDef
@@ -75,3 +88,5 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
75
88
76
89
return 0 ;
77
90
}
91
+
92
+ #endif // Py_TRACE_REFS
You can’t perform that action at this time.
0 commit comments