File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -877,6 +877,12 @@ def check_bolt_optimized():
877877 return '--enable-bolt' in config_args
878878
879879
880+ with warnings .catch_warnings ():
881+ # ignore DeprecationWarning on sys.abiflags change on Windows
882+ warnings .simplefilter ('ignore' , DeprecationWarning )
883+ HAS_SYS_ABIFLAGS = hasattr (sys , 'abiflags' ) # equal to `not sys.platform.startswith('win')`
884+
885+
880886Py_GIL_DISABLED = bool (sysconfig .get_config_var ('Py_GIL_DISABLED' ))
881887
882888def requires_gil_enabled (msg = "needs the GIL enabled" ):
Original file line number Diff line number Diff line change @@ -1355,7 +1355,7 @@ def test_pystats(self):
13551355 sys ._stats_dump ()
13561356
13571357 @test .support .cpython_only
1358- @unittest .skipUnless (hasattr ( sys , 'abiflags' ) , 'need sys.abiflags' )
1358+ @unittest .skipUnless (support . HAS_SYS_ABIFLAGS , 'need sys.abiflags' )
13591359 def test_disable_gil_abi (self ):
13601360 self .assertEqual ('t' in sys .abiflags , support .Py_GIL_DISABLED )
13611361
You can’t perform that action at this time.
0 commit comments