Commit cb6fdf2c authored by Gregory P. Smith's avatar Gregory P. Smith

issue10838: Rename the subprocess.mswindows internal global to _mswindows.

It is internal only, not a documented API.
parent ace55865
...@@ -356,7 +356,7 @@ Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"}) ...@@ -356,7 +356,7 @@ Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"})
""" """
import sys import sys
mswindows = (sys.platform == "win32") _mswindows = (sys.platform == "win32")
import io import io
import os import os
...@@ -399,7 +399,7 @@ class TimeoutExpired(SubprocessError): ...@@ -399,7 +399,7 @@ class TimeoutExpired(SubprocessError):
(self.cmd, self.timeout)) (self.cmd, self.timeout))
if mswindows: if _mswindows:
import threading import threading
import msvcrt import msvcrt
import _winapi import _winapi
...@@ -438,7 +438,7 @@ __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput", ...@@ -438,7 +438,7 @@ __all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
# NOTE: We intentionally exclude list2cmdline as it is # NOTE: We intentionally exclude list2cmdline as it is
# considered an internal implementation detail. issue10838. # considered an internal implementation detail. issue10838.
if mswindows: if _mswindows:
from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP, from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
STD_ERROR_HANDLE, SW_HIDE, STD_ERROR_HANDLE, SW_HIDE,
...@@ -765,7 +765,7 @@ class Popen(object): ...@@ -765,7 +765,7 @@ class Popen(object):
if not isinstance(bufsize, int): if not isinstance(bufsize, int):
raise TypeError("bufsize must be an integer") raise TypeError("bufsize must be an integer")
if mswindows: if _mswindows:
if preexec_fn is not None: if preexec_fn is not None:
raise ValueError("preexec_fn is not supported on Windows " raise ValueError("preexec_fn is not supported on Windows "
"platforms") "platforms")
...@@ -825,7 +825,7 @@ class Popen(object): ...@@ -825,7 +825,7 @@ class Popen(object):
# quickly terminating child could make our fds unwrappable # quickly terminating child could make our fds unwrappable
# (see #8458). # (see #8458).
if mswindows: if _mswindows:
if p2cwrite != -1: if p2cwrite != -1:
p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0) p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0)
if c2pread != -1: if c2pread != -1:
...@@ -1002,7 +1002,7 @@ class Popen(object): ...@@ -1002,7 +1002,7 @@ class Popen(object):
raise TimeoutExpired(self.args, orig_timeout) raise TimeoutExpired(self.args, orig_timeout)
if mswindows: if _mswindows:
# #
# Windows methods # Windows methods
# #
......
...@@ -2422,7 +2422,7 @@ class ProcessTestCaseNoPoll(ProcessTestCase): ...@@ -2422,7 +2422,7 @@ class ProcessTestCaseNoPoll(ProcessTestCase):
def test__all__(self): def test__all__(self):
"""Ensure that __all__ is populated properly.""" """Ensure that __all__ is populated properly."""
intentionally_excluded = set(("list2cmdline", "mswindows", "MAXFD")) intentionally_excluded = set(("list2cmdline",))
exported = set(subprocess.__all__) exported = set(subprocess.__all__)
possible_exports = set() possible_exports = set()
import types import types
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment