MCPcopy Index your code
hub / github.com/bpython/bpython / keyboard_interrupt

Method keyboard_interrupt

bpython/urwid.py:953–967  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

951 self.prompt(False)
952
953 def keyboard_interrupt(self):
954 # If the user is currently editing, interrupt him. This
955 # mirrors what the regular python REPL does.
956 if self.edit is not None:
957 # XXX this is a lot of code, and I am not sure it is
958 # actually enough code. Needs some testing.
959 self.edit.make_readonly()
960 self.edit = None
961 self.buffer = []
962 self.echo("KeyboardInterrupt")
963 self.prompt(False)
964 else:
965 # I do not quite remember if this is reachable, but let's
966 # be safe.
967 self.echo("KeyboardInterrupt")
968
969 def prompt(self, more):
970 # Clear current output here, or output resulting from the

Callers 2

pushMethod · 0.95

Calls 3

echoMethod · 0.95
promptMethod · 0.95
make_readonlyMethod · 0.80

Tested by

no test coverage detected