Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb6fdf2

Browse files
committed
issue10838: Rename the subprocess.mswindows internal global to _mswindows.
It is internal only, not a documented API.
1 parent ace5586 commit cb6fdf2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lib/subprocess.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class Popen(args, bufsize=-1, executable=None,
356356
"""
357357

358358
import sys
359-
mswindows = (sys.platform == "win32")
359+
_mswindows = (sys.platform == "win32")
360360

361361
import io
362362
import os
@@ -399,7 +399,7 @@ def __str__(self):
399399
(self.cmd, self.timeout))
400400

401401

402-
if mswindows:
402+
if _mswindows:
403403
import threading
404404
import msvcrt
405405
import _winapi
@@ -438,7 +438,7 @@ class STARTUPINFO:
438438
# NOTE: We intentionally exclude list2cmdline as it is
439439
# considered an internal implementation detail. issue10838.
440440

441-
if mswindows:
441+
if _mswindows:
442442
from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
443443
STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
444444
STD_ERROR_HANDLE, SW_HIDE,
@@ -765,7 +765,7 @@ def __init__(self, args, bufsize=-1, executable=None,
765765
if not isinstance(bufsize, int):
766766
raise TypeError("bufsize must be an integer")
767767

768-
if mswindows:
768+
if _mswindows:
769769
if preexec_fn is not None:
770770
raise ValueError("preexec_fn is not supported on Windows "
771771
"platforms")
@@ -825,7 +825,7 @@ def __init__(self, args, bufsize=-1, executable=None,
825825
# quickly terminating child could make our fds unwrappable
826826
# (see #8458).
827827

828-
if mswindows:
828+
if _mswindows:
829829
if p2cwrite != -1:
830830
p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0)
831831
if c2pread != -1:
@@ -1002,7 +1002,7 @@ def _check_timeout(self, endtime, orig_timeout):
10021002
raise TimeoutExpired(self.args, orig_timeout)
10031003

10041004

1005-
if mswindows:
1005+
if _mswindows:
10061006
#
10071007
# Windows methods
10081008
#

Lib/test/test_subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2422,7 +2422,7 @@ def tearDown(self):
24222422

24232423
def test__all__(self):
24242424
"""Ensure that __all__ is populated properly."""
2425-
intentionally_excluded = set(("list2cmdline", "mswindows", "MAXFD"))
2425+
intentionally_excluded = set(("list2cmdline",))
24262426
exported = set(subprocess.__all__)
24272427
possible_exports = set()
24282428
import types

0 commit comments

Comments
 (0)