[Python-checkins] cpython: issue10838: Rename the subprocess.mswindows internal global to _mswindows.

gregory.p.smith python-checkins at python.org
Wed Apr 8 01:11:43 CEST 2015


https://hg.python.org/cpython/rev/4c14afc3f931
changeset: 95481:4c14afc3f931
user: Gregory P. Smith <greg at krypto.org>
date: Tue Apr 07 16:11:33 2015 -0700
summary:
 issue10838: Rename the subprocess.mswindows internal global to _mswindows.
It is internal only, not a documented API.
files:
 Lib/subprocess.py | 12 ++++++------
 Lib/test/test_subprocess.py | 2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -356,7 +356,7 @@
 """
 
 import sys
-mswindows = (sys.platform == "win32")
+_mswindows = (sys.platform == "win32")
 
 import io
 import os
@@ -399,7 +399,7 @@
 (self.cmd, self.timeout))
 
 
-if mswindows:
+if _mswindows:
 import threading
 import msvcrt
 import _winapi
@@ -438,7 +438,7 @@
 # NOTE: We intentionally exclude list2cmdline as it is
 # considered an internal implementation detail. issue10838.
 
-if mswindows:
+if _mswindows:
 from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
 STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
 STD_ERROR_HANDLE, SW_HIDE,
@@ -765,7 +765,7 @@
 if not isinstance(bufsize, int):
 raise TypeError("bufsize must be an integer")
 
- if mswindows:
+ if _mswindows:
 if preexec_fn is not None:
 raise ValueError("preexec_fn is not supported on Windows "
 "platforms")
@@ -825,7 +825,7 @@
 # quickly terminating child could make our fds unwrappable
 # (see #8458).
 
- if mswindows:
+ if _mswindows:
 if p2cwrite != -1:
 p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0)
 if c2pread != -1:
@@ -1002,7 +1002,7 @@
 raise TimeoutExpired(self.args, orig_timeout)
 
 
- if mswindows:
+ if _mswindows:
 #
 # Windows methods
 #
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2422,7 +2422,7 @@
 
 def test__all__(self):
 """Ensure that __all__ is populated properly."""
- intentionally_excluded = set(("list2cmdline", "mswindows", "MAXFD"))
+ intentionally_excluded = set(("list2cmdline",))
 exported = set(subprocess.__all__)
 possible_exports = set()
 import types
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /