summaryrefslogtreecommitdiff
path: root/tests/pyscript/recursive.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-14 16:28:41 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-14 16:28:41 -0500
commit9156618a56d635bb51261d019a3703a1b4e3b588 (patch)
tree3f35d07cf668ec156dac6e97e612569c83aa36c6 /tests/pyscript/recursive.py
parent013b9e0a2c75e17f8aa0e0f7cbe50d84d2f657d8 (diff)
downloadcmd2-git-9156618a56d635bb51261d019a3703a1b4e3b588.tar.gz
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.
Diffstat (limited to 'tests/pyscript/recursive.py')
-rw-r--r--tests/pyscript/recursive.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/pyscript/recursive.py b/tests/pyscript/recursive.py
index 21550592..7f02bb78 100644
--- a/tests/pyscript/recursive.py
+++ b/tests/pyscript/recursive.py
@@ -5,6 +5,7 @@
Example demonstrating that calling run_pyscript recursively inside another Python script isn't allowed
"""
import os
+import sys
app.cmd_echo = True
my_dir = (os.path.dirname(os.path.realpath(sys.argv[0])))