From 9156618a56d635bb51261d019a3703a1b4e3b588 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Fri, 14 Feb 2020 16:28:41 -0500 Subject: Fixed bug where pyscripts could edit cmd2.Cmd.py_locals dictionary. Fixed bug where cmd2 set sys.path[0] for a pyscript to its cwd instead of the script's directory. Fixed bug where sys.path was not being restored after a pyscript ran. Setting the following pyscript variables: __name__: __main__ __file__: script path (as typed) Removed do_py.run() function since it didn't handle arguments and offered no benefit over run_pyscript. --- tests/pyscript/run.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tests/pyscript/run.py (limited to 'tests/pyscript/run.py') diff --git a/tests/pyscript/run.py b/tests/pyscript/run.py deleted file mode 100644 index 47250a10..00000000 --- a/tests/pyscript/run.py +++ /dev/null @@ -1,6 +0,0 @@ -# flake8: noqa F821 -import os - -app.cmd_echo = True -my_dir = (os.path.dirname(os.path.realpath(sys.argv[0]))) -run(os.path.join(my_dir, 'to_run.py')) -- cgit v1.2.1