@@ -618,17 +618,21 @@ def test_abiflags(self):
618618 self .assertIsInstance (abiflags , str )
619619 self .assertIsInstance (ABIFLAGS , str )
620620 self .assertIn (abiflags , ABIFLAGS )
621- if ABIFLAGS :
622- self .assertLessEqual (ABIFLAGS .count ('_' ), 1 ) # example value on Windows: 't_d'
623- self .assertTrue (ABIFLAGS .replace ('_' , '' ).isalpha (), ABIFLAGS )
624621
625622 if os .name == 'nt' :
626623 self .assertEqual (abiflags , '' )
624+ # Example values: '', 't', 't_d', '_d'
625+ self .assertLessEqual (ABIFLAGS .count ('_' ), 1 )
626+ else :
627+ # Example values: '', 't', 'td', 'd'
628+ self .assertNotIn ('_' , ABIFLAGS )
629+ if ABIFLAGS :
630+ self .assertTrue (ABIFLAGS .replace ('_' , '' ).isalpha (), ABIFLAGS )
627631
628632 if support .Py_DEBUG :
629633 # The 'd' flag should always be the last one.
630634 # On Windows, the debug flag is used differently with a underscore prefix.
631- # For example, `python{X}.{Y}td` on Unix and ``` python{X}.{Y}t_d.exe` on Windows.
635+ # For example, `python{X}.{Y}td` on Unix and `python{X}.{Y}t_d.exe` on Windows.
632636 self .assertEndsWith (ABIFLAGS , 'd' )
633637 else :
634638 self .assertNotIn ('d' , ABIFLAGS )
0 commit comments