File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 88import shlex
99import shutil
1010import subprocess
11+ import sys
1112import unittest
1213from test import support
1314
1415
1516SOURCE = os .path .join (os .path .dirname (__file__ ), 'extension.c' )
1617SETUP = os .path .join (os .path .dirname (__file__ ), 'setup.py' )
18+ Py_TRACE_REFS = hasattr (sys , 'getobjects' )
1719
1820
1921# With MSVC on a debug build, the linker fails with: cannot open file
@@ -47,6 +49,9 @@ def test_build_limited_c11(self):
4749 self .check_build ('_test_limited_c11_cext' , limited = True , std = 'c11' )
4850
4951 def check_build (self , extension_name , std = None , limited = False ):
52+ if limited and Py_TRACE_REFS :
53+ self .skipTest ('Py_LIMITED_API is incompatible with Py_TRACE_REFS' )
54+
5055 venv_dir = 'env'
5156 with support .setup_venv_with_pip_setuptools_wheel (venv_dir ) as python_exe :
5257 self ._check_build (extension_name , python_exe ,
Original file line number Diff line number Diff line change 44import shlex
55import shutil
66import subprocess
7+ import sys
78import unittest
89from test import support
910
1011
1112SOURCE = os .path .join (os .path .dirname (__file__ ), 'extension.cpp' )
1213SETUP = os .path .join (os .path .dirname (__file__ ), 'setup.py' )
14+ Py_TRACE_REFS = hasattr (sys , 'getobjects' )
1315
1416
1517# With MSVC on a debug build, the linker fails with: cannot open file
@@ -45,6 +47,9 @@ def test_build_limited(self):
4547 self .check_build ('_testcppext_limited' , limited = True )
4648
4749 def check_build (self , extension_name , std = None , limited = False ):
50+ if limited and Py_TRACE_REFS :
51+ self .skipTest ('Py_LIMITED_API is incompatible with Py_TRACE_REFS' )
52+
4853 venv_dir = 'env'
4954 with support .setup_venv_with_pip_setuptools_wheel (venv_dir ) as python_exe :
5055 self ._check_build (extension_name , python_exe ,
You can’t perform that action at this time.
0 commit comments