summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-01-19 20:49:02 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-01-19 20:49:02 (GMT)
commite047e6dd092a7d8f512914de78a8193ba6c518c4 (patch)
treedb88c86809561678464c25a758c38bf4fc3d36fa /Lib/subprocess.py
parent060e6855a802a9e9bf2e6905342f704f64a3a26d (diff)
downloadcpython-e047e6dd092a7d8f512914de78a8193ba6c518c4.zip
cpython-e047e6dd092a7d8f512914de78a8193ba6c518c4.tar.gz
cpython-e047e6dd092a7d8f512914de78a8193ba6c518c4.tar.bz2
fix comment typos, use not arg instead of arg == "", add test coverage
for inside of the final if needquotes: within subprocess.list2cmdline().
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 29c25bc..a94490c 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -497,7 +497,7 @@ def list2cmdline(seq):
if result:
result.append(' ')
- needquote = (" " in arg) or ("\t" in arg) or arg == ""
+ needquote = (" " in arg) or ("\t" in arg) or not arg
if needquote:
result.append('"')
@@ -506,7 +506,7 @@ def list2cmdline(seq):
# Don't know if we need to double yet.
bs_buf.append(c)
elif c == '"':
- # Double backspaces.
+ # Double backslashes.
result.append('\\' * len(bs_buf)*2)
bs_buf = []
result.append('\\"')
@@ -517,7 +517,7 @@ def list2cmdline(seq):
bs_buf = []
result.append(c)
- # Add remaining backspaces, if any.
+ # Add remaining backslashes, if any.
if bs_buf:
result.extend(bs_buf)