MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / SigintUnhandledCommandSet

Class SigintUnhandledCommandSet

tests/test_commandset.py:659–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657
658 # shows that the command is interrupted if we don't report we've handled the sigint
659 class SigintUnhandledCommandSet(cmd2.CommandSet):
660 def do_bar(self, _) -> None:
661 """Bar Command"""
662 self._cmd.poutput("in do bar")
663 self._cmd.sigint_handler(signal.SIGINT, None)
664 self._cmd.poutput("end of do bar")
665
666 cs2 = SigintUnhandledCommandSet()
667 manual_command_sets_app.register_command_set(cs2)

Callers 1

test_commandset_sigintFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_commandset_sigintFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…