diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-20 22:43:00 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-20 22:43:00 -0400 |
| commit | 8f91bf21b65b68674f5a9bbed1ebd5ff44a40df0 (patch) | |
| tree | 83916cf6382a0436d1276b61a26dd30c58834f93 /cmd2.py | |
| parent | 58a2248c5be7ae6390eb9f29af2d81748377e81f (diff) | |
| download | cmd2-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-x | cmd2.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |
