(self, e)
Handle a Break event.
Handle a Break event.
Handle a Break event .
def _handle_break(self, e):
        """Handle a Break event."""
        # print ^C at current position
        if not self.input_mode and not e.stop:
            self._console.write(b'^C')
        # if we're in a program, save pointer
        pos = -1
        if self.run_mode:
            pos = self.current_statement
            if self.parser.redo_on_break:
                self.stop = pos
            else:
                self._program.bytecode.skip_to(tk.END_STATEMENT)
                self.stop = self._program.bytecode.tell()
        self._console.start_line()
        self._console.write(e.get_message(self._program.get_line_number(pos)))
        self.set_parse_mode(False)
        self.input_mode = False
        self.parser.redo_on_break = False
def _handle_break ( self , e ) : # print ^C at current position if not self . input_mode and not e . stop : self . _console . write ( b'^C' ) # if we're in a program, save pointer pos = - 1 if self . run_mode : pos = self . current_statement if self . parser . redo_on_break : self . stop = pos else : self . _program . bytecode . skip_to ( tk . END_STATEMENT ) self . stop = self . _program . bytecode . tell ( ) self . _console . start_line ( ) self . _console . write ( e . get_message ( self . _program . get_line_number ( pos ) ) ) self . set_parse_mode ( False ) self . input_mode = False self . parser . redo_on_break = False