Skip to content

Commit 430a940

Browse files
committed
Disable Limited API tests with Py_TRACE_REFS
1 parent 63140b4 commit 430a940

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

Lib/test/test_call.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import itertools
1010
import gc
1111
import contextlib
12+
import sys
1213

1314

1415
class BadStr(str):
@@ -759,6 +760,9 @@ def __call__(self, *args):
759760
self.assertEqual(expected, meth(*args1, **kwargs))
760761
self.assertEqual(expected, wrapped(*args, **kwargs))
761762

763+
@unittest.skipIf(
764+
hasattr(sys, 'getobjects'),
765+
"Limited API is not compatible with Py_TRACE_REFS")
762766
def test_vectorcall_limited(self):
763767
from _testcapi import pyobject_vectorcall
764768
obj = _testcapi.LimitedVectorCallClass()

Modules/_testcapi/vectorcall_limited.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
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+
114
#define Py_LIMITED_API 0x030c0000 // 3.12
215
#include "parts.h"
316
#include "structmember.h" // PyMemberDef
@@ -75,3 +88,5 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
7588

7689
return 0;
7790
}
91+
92+
#endif // Py_TRACE_REFS

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy