summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-07-01 20:54:06 -0400
committerGitHub <noreply@github.com>2017-07-01 20:54:06 -0400
commit26743a702afa42ff199614def9f7c5eb04308f76 (patch)
treef249feee0eda6894482d45045a796271851ad7dd /cmd2.py
parent79d5b675ab52a0522462e0ccfdab236787f3dac0 (diff)
parent4e8c08eb8fb22afa61b805f545c0d0460e79184e (diff)
downloadcmd2-git-26743a702afa42ff199614def9f7c5eb04308f76.tar.gz
Merge pull request #162 from python-cmd2/py_tests
Fixed a major bug in the pyscript command on Windows
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index 89ed1b7c..b04bf215 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1421,7 +1421,7 @@ Paths or arguments that contain spaces must be enclosed in quotes
arg = shlex.split(arg, posix=POSIX_SHLEX)
# Get the absolute path of the script
- script_path = os.path.abspath(os.path.expanduser(arg[0]))
+ script_path = os.path.expanduser(arg[0])
# Save current command line arguments
orig_args = sys.argv
@@ -1430,8 +1430,8 @@ Paths or arguments that contain spaces must be enclosed in quotes
sys.argv = [script_path]
sys.argv.extend(arg[1:])
- # Run the script
- self.do_py("run('{}')".format(script_path))
+ # Run the script - use repr formatting to escape things which need to be escaped to prevent issues on Windows
+ self.do_py("run({!r})".format(script_path))
# Restore command line arguments to original state
sys.argv = orig_args