diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-01 20:54:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 20:54:06 -0400 |
commit | 26743a702afa42ff199614def9f7c5eb04308f76 (patch) | |
tree | f249feee0eda6894482d45045a796271851ad7dd /cmd2.py | |
parent | 79d5b675ab52a0522462e0ccfdab236787f3dac0 (diff) | |
parent | 4e8c08eb8fb22afa61b805f545c0d0460e79184e (diff) | |
download | cmd2-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-x | cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |