(self)
| 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 |
no test coverage detected