diff options
-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 |