#2304: fix incorporating Eric Smith's .format suggestion and tested on Ubuntu as well as Windows

This commit is contained in:
Tim Golden 2010-08-12 11:00:35 +00:00
parent b13a23639c
commit 8e4756c763
2 changed files with 45 additions and 3 deletions

View file

@ -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