File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -506,11 +506,6 @@ def _init_config_vars():
506506 base_prefix = _BASE_PREFIX
507507 base_exec_prefix = _BASE_EXEC_PREFIX
508508
509- with warnings .catch_warnings ():
510- # ignore DeprecationWarning on sys.abiflags change on Windows
511- warnings .simplefilter ('ignore' , DeprecationWarning )
512- abiflags = getattr (sys , 'abiflags' , '' )
513-
514509 if os .name == 'posix' :
515510 _init_posix (_CONFIG_VARS )
516511 # If we are cross-compiling, load the prefixes from the Makefile instead.
@@ -520,6 +515,10 @@ def _init_config_vars():
520515 base_prefix = _CONFIG_VARS ['host_prefix' ]
521516 base_exec_prefix = _CONFIG_VARS ['host_exec_prefix' ]
522517 abiflags = _CONFIG_VARS ['ABIFLAGS' ]
518+ else :
519+ abiflags = sys .abiflags
520+ else :
521+ abiflags = '' # sys.abiflags is absent on Windows
523522
524523 # Normalized versions of prefix and exec_prefix are handy to have;
525524 # in fact, these are the standard versions used most places in the
Original file line number Diff line number Diff line change @@ -719,6 +719,9 @@ def test_attributes(self):
719719 self .assertIn (sys .float_repr_style , ('short' , 'legacy' ))
720720 if not sys .platform .startswith ('win' ):
721721 self .assertIsInstance (sys .abiflags , str )
722+
723+ # test hasattr(sys, 'abiflags') == (os.name != 'nt)
724+ self .assertEqual (os .name , 'posix' )
722725 else :
723726 absent = object ()
724727 with self .assertWarnsRegex (
@@ -743,6 +746,9 @@ def test_attributes(self):
743746 ):
744747 _ = sys .abiflags
745748
749+ # test hasattr(sys, 'abiflags') == (os.name != 'nt)
750+ self .assertEqual (os .name , 'nt' )
751+
746752 def test_thread_info (self ):
747753 info = sys .thread_info
748754 self .assertEqual (len (info ), 3 )
You can’t perform that action at this time.
0 commit comments