[3.11] Add support.MS_WINDOWS constant (#110446) (#110452) (#110464)

[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)

Add support.MS_WINDOWS constant (#110446)

(cherry picked from commit e0c4437793)
(cherry picked from commit e188534607)
This commit is contained in:
Victor Stinner 2023-10-06 12:19:49 +02:00 committed by GitHub
parent 4499e6caff
commit 88223f15d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 27 additions and 22 deletions

View file

@ -15,8 +15,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
@ -266,7 +265,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'''