mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Add support.MS_WINDOWS constant (#110446)
This commit is contained in:
parent
3c0f65ebce
commit
e0c4437793
15 changed files with 22 additions and 33 deletions
|
@ -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'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue