summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-03-20 22:43:00 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-03-20 22:43:00 -0400
commit8f91bf21b65b68674f5a9bbed1ebd5ff44a40df0 (patch)
tree83916cf6382a0436d1276b61a26dd30c58834f93 /cmd2.py
parent58a2248c5be7ae6390eb9f29af2d81748377e81f (diff)
downloadcmd2-git-8f91bf21b65b68674f5a9bbed1ebd5ff44a40df0.tar.gz
Fixed unit test failure on Python 2.7
The shlex.quote() function wasn't added until Python 3.3. TODO: - <TAB><TAB> is broken on Python 2.7
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index 4da1c7f9..d7a4d34d 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2659,7 +2659,8 @@ Usage: Usage: unalias [-a] name [name ...]
tokens[index] = strip_quotes(tokens[index])
tokens[index] = os.path.expandvars(tokens[index])
tokens[index] = os.path.expanduser(tokens[index])
- tokens[index] = shlex.quote(tokens[index])
+ if six.PY3:
+ tokens[index] = shlex.quote(tokens[index])
expanded_command = ' '.join(tokens)
proc = subprocess.Popen(expanded_command, stdout=self.stdout, shell=True)