From 8f91bf21b65b68674f5a9bbed1ebd5ff44a40df0 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 20 Mar 2018 22:43:00 -0400 Subject: Fixed unit test failure on Python 2.7 The shlex.quote() function wasn't added until Python 3.3. TODO: - is broken on Python 2.7 --- cmd2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd2.py') 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) -- cgit v1.2.1