From 8e4756c7635cda029e75d3c9ad6daefce3a707e6 Mon Sep 17 00:00:00 2001 From: Tim Golden Date: Thu, 12 Aug 2010 11:00:35 +0000 Subject: #2304: fix incorporating Eric Smith's .format suggestion and tested on Ubuntu as well as Windows --- Lib/subprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/subprocess.py') diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 395b7a3400..68de777644 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -853,8 +853,8 @@ class Popen(object): startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW startupinfo.wShowWindow = _subprocess.SW_HIDE comspec = os.environ.get("COMSPEC", "cmd.exe") - args = comspec + " /c " + args - if (_subprocess.GetVersion() >= 0x80000000L or + args = '{} /c "{}"'.format (comspec, args) + if (_subprocess.GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com"): # Win9x, or using command.com on NT. We need to # use the w9xpopen intermediate program. For more -- cgit v1.2.1