From eee9a5e3406fb6c1862bc7d3f59d62d0e45b3a79 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 30 Oct 2019 17:15:02 -0400 Subject: [PATCH 1/2] Only removing ipy from cmd2 instances instead of the class when use_ipython is False --- cmd2/cmd2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 7d2cad205..6a6001074 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -368,10 +368,10 @@ def __init__(self, completekey: str = 'tab', stdin=None, stdout=None, *, :param shortcuts: dictionary containing shortcuts for commands. If not supplied, then defaults to constants.DEFAULT_SHORTCUTS. """ - # If use_ipython is False, make sure the do_ipy() method doesn't exit + # If use_ipython is False, make sure the ipy command isn't available in this instance if not use_ipython: try: - del Cmd.do_ipy + self.do_ipy = None except AttributeError: pass From 8056c5b6c224a603ba7c08c29a260cde4338d83d Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 30 Oct 2019 17:19:46 -0400 Subject: [PATCH 2/2] Updated change log --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b2718a0..e82257823 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## 0.9.20 (TBD, 2019) +* Bug Fixes + * Fixed bug where setting `use_ipython` to False removed ipy command from the entire `cmd2.Cmd` class instead of + just the instance being created * Enhancements * Send all startup script paths to run_script. Previously we didn't do this if the file was empty, but that showed no record of the run_script command in history.