diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-04-20 23:26:20 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-04-20 23:26:20 -0400 |
commit | ae946b70b24c61673e8b7c880ccbdf91768d456d (patch) | |
tree | 48fa71dec63e32b876dfe5e733367aef258892f5 | |
parent | f05dfe73d675e198ad271fa23c7dcdcd1f988551 (diff) | |
download | cmd2-git-ae946b70b24c61673e8b7c880ccbdf91768d456d.tar.gz |
Updated error text
-rw-r--r-- | cmd2/cmd2.py | 6 | ||||
-rw-r--r-- | tests/test_run_pyscript.py | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index c22cb76d..98969d10 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3191,8 +3191,7 @@ class Cmd(cmd.Cmd): saved_sys_path = None if self.in_pyscript(): - err = "Recursively entering interactive Python shells is not allowed." - self.perror(err) + self.perror("Recursively entering interactive Python shells is not allowed") return try: @@ -3367,8 +3366,7 @@ class Cmd(cmd.Cmd): exit_msg='Leaving IPython, back to {}'.format(sys.argv[0])) if self.in_pyscript(): - err = "Recursively entering interactive Python shells is not allowed." - self.perror(err) + self.perror("Recursively entering interactive Python shells is not allowed") return try: diff --git a/tests/test_run_pyscript.py b/tests/test_run_pyscript.py index 1776614f..6110e3ac 100644 --- a/tests/test_run_pyscript.py +++ b/tests/test_run_pyscript.py @@ -35,7 +35,7 @@ def test_run_pyscript(base_app, request): def test_run_pyscript_recursive_not_allowed(base_app, request): test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', 'recursive.py') - expected = 'Recursively entering interactive Python shells is not allowed.' + expected = 'Recursively entering interactive Python shells is not allowed' out, err = run_cmd(base_app, "run_pyscript {}".format(python_script)) assert err[0] == expected |