Skip to content

Commit 75b6c51

Browse files
committed
Make 'd' flag test more platform specific
1 parent 23b6e6c commit 75b6c51

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Lib/test/test_sysconfig.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,16 @@ def test_abiflags(self):
628628
def test_abi_debug(self):
629629
ABIFLAGS = sysconfig.get_config_var('ABIFLAGS')
630630
if support.Py_DEBUG:
631-
# The 'd' flag should always be the last one.
632-
# On Windows, the debug flag is used differently with a underscore prefix.
633-
# For example, `python{X}.{Y}td` on Unix and `python{X}.{Y}t_d.exe` on Windows.
634-
self.assertEndsWith(ABIFLAGS, 'd')
631+
self.assertIn('d', ABIFLAGS)
635632
else:
636633
self.assertNotIn('d', ABIFLAGS)
637634

635+
# The 'd' flag should always be the last one on Windows.
636+
# On Windows, the debug flag is used differently with a underscore prefix.
637+
# For example, `python{X}.{Y}td` on Unix and `python{X}.{Y}t_d.exe` on Windows.
638+
if support.Py_DEBUG and sys.platform.endswith('win'):
639+
self.assertEndsWith(ABIFLAGS, '_d')
640+
638641
def test_abi_thread(self):
639642
abi_thread = sysconfig.get_config_var('abi_thread')
640643
ABIFLAGS = sysconfig.get_config_var('ABIFLAGS')

0 commit comments

Comments
 (0)