mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.12] Add support.MS_WINDOWS constant (#110446) (#110452) Add support.MS_WINDOWS constant (#110446) (cherry picked from commite0c4437793
) (cherry picked from commite188534607
)
This commit is contained in:
parent
4499e6caff
commit
88223f15d7
10 changed files with 27 additions and 22 deletions
|
@ -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'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue