summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.md1
-rwxr-xr-xcmd2.py3
-rw-r--r--tests/test_cmd2.py2
3 files changed, 2 insertions, 4 deletions
diff --git a/CHANGES.md b/CHANGES.md
index b041437d..82b4a59e 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -10,6 +10,7 @@ News
* Fixed a couple bugs in interacting with pastebuffer/clipboard on macOS and Linux
* Fixed a couple bugs in edit and save commands if called when history is empty
* Ability to pipe ``cmd2`` command output to a shell command is now more reliable, particularly on Windows
+ * Fixed a bug in ``pyscript`` command on Windows related to ``\`` being interpreted as an escape
* Enhancements
* Ensure that path and shell command tab-completion results are alphabetically sorted
* Removed feature for load command to load scripts from URLS
diff --git a/cmd2.py b/cmd2.py
index 0177a18d..b04bf215 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1431,8 +1431,7 @@ Paths or arguments that contain spaces must be enclosed in quotes
sys.argv.extend(arg[1:])
# Run the script - use repr formatting to escape things which need to be escaped to prevent issues on Windows
- py_cmd = "run({!r})".format(script_path)
- self.do_py(py_cmd)
+ self.do_py("run({!r})".format(script_path))
# Restore command line arguments to original state
sys.argv = orig_args
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 1bed3c07..592e6af2 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -131,8 +131,6 @@ def test_base_run_python_script(base_app, capsys, request):
assert out == expected
-@pytest.mark.skipif(sys.platform == 'win32',
- reason="Unit test doesn't work on win32, but feature does")
def test_base_run_pyscript(base_app, capsys, request):
test_dir = os.path.dirname(request.module.__file__)
python_script = os.path.join(test_dir, 'script.py')