Add support.MS_WINDOWS constant (#110446)

This commit is contained in:
Victor Stinner 2023-10-06 02:37:28 +02:00 committed by GitHub
parent 3c0f65ebce
commit e0c4437793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 22 additions and 33 deletions

View file

@ -9,7 +9,6 @@ import sysconfig
from test import support
MS_WINDOWS = (sys.platform == 'win32')
SOURCE = os.path.join(os.path.dirname(__file__), 'extension.cpp')
SETUP = os.path.join(os.path.dirname(__file__), 'setup.py')
@ -30,7 +29,7 @@ class TestCPPExt(unittest.TestCase):
# With MSVC, the linker fails with: cannot open file 'python311.lib'
# https://github.com/python/cpython/pull/32175#issuecomment-1111175897
@unittest.skipIf(MS_WINDOWS, 'test fails on Windows')
@unittest.skipIf(support.MS_WINDOWS, 'test fails on Windows')
# Building and running an extension in clang sanitizing mode is not
# straightforward
@unittest.skipIf(

View file

@ -4,15 +4,13 @@ import os
import shlex
import sys
import sysconfig
from test import support
from setuptools import setup, Extension
MS_WINDOWS = (sys.platform == 'win32')
SOURCE = 'extension.cpp'
if not MS_WINDOWS:
if not support.MS_WINDOWS:
# C++ compiler flags for GCC and clang
CPPFLAGS = [
# gh-91321: The purpose of _testcppext extension is to check that building