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

@ -14,8 +14,7 @@ from test import support
from test.support import os_helper
MS_WINDOWS = (sys.platform == 'win32')
if MS_WINDOWS:
if support.MS_WINDOWS:
import msvcrt
else:
from asyncio import unix_events
@ -283,7 +282,7 @@ class SubprocessMixin:
rfd, wfd = os.pipe()
self.addCleanup(os.close, rfd)
self.addCleanup(os.close, wfd)
if MS_WINDOWS:
if support.MS_WINDOWS:
handle = msvcrt.get_osfhandle(rfd)
os.set_handle_inheritable(handle, True)
code = textwrap.dedent(f'''