diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-30 12:41:02 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-04-30 13:12:23 -0400 |
commit | 79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255 (patch) | |
tree | 1e04c689b17f752732c67a10bcc76cb4cf4bee1a /cmd2/cmd2.py | |
parent | 37d415b4bbfd6efd383a20062df68f627451ccf7 (diff) | |
download | cmd2-git-79bf87d1e333ea5fe0dfeb61c707eb9bddfd0255.tar.gz |
Removed cmd2.Cmd.quit_on_sigint.
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index cc1d5e6b..418f8a4f 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -293,7 +293,6 @@ class Cmd(cmd.Cmd): # Attributes which should NOT be dynamically settable via the set command at runtime self.default_to_shell = False # Attempt to run unrecognized commands as shell commands - self.quit_on_sigint = False # Ctrl-C at the prompt will quit the program instead of just resetting prompt self.allow_redirection = allow_redirection # Security setting to prevent redirection of stdout # Attributes which ARE dynamically settable via the set command at runtime @@ -2490,13 +2489,10 @@ class Cmd(cmd.Cmd): nextline = '\n' self.poutput(nextline) line = f'{self._multiline_in_progress}{nextline}' - except KeyboardInterrupt as ex: - if self.quit_on_sigint: - raise ex - else: - self.poutput('^C') - statement = self.statement_parser.parse('') - break + except KeyboardInterrupt: + self.poutput('^C') + statement = self.statement_parser.parse('') + break finally: self._at_continuation_prompt = False @@ -3067,12 +3063,9 @@ class Cmd(cmd.Cmd): # Get commands from user try: line = self._read_command_line(self.prompt) - except KeyboardInterrupt as ex: - if self.quit_on_sigint: - raise ex - else: - self.poutput('^C') - line = '' + except KeyboardInterrupt: + self.poutput('^C') + line = '' # Run the command along with all associated pre and post hooks stop = self.onecmd_plus_hooks(line) |