MCPcopy Index your code
hub / github.com/python/cpython / prepare

Method prepare

Lib/_pyrepl/reader.py:588–607  ·  view source on GitHub ↗

Get ready to run. Call restore when finished. You must not write to the console in between the calls to prepare and restore.

(self)

Source from the content-addressed store, hash-verified

586 self.arg = None
587
588 def prepare(self) -> None:
589 """Get ready to run. Call restore when finished. You must not
590 write to the console in between the calls to prepare and
591 restore."""
592 try:
593 self.console.prepare()
594 self.arg = None
595 self.finished = False
596 del self.buffer[:]
597 self.pos = 0
598 self.dirty = True
599 self.last_command = None
600 self.calc_screen()
601 except BaseException:
602 self.restore()
603 raise
604
605 while self.scheduled_commands:
606 cmd = self.scheduled_commands.pop()
607 self.do_cmd((cmd, []))
608
609 def last_command_is(self, cls: type) -> bool:
610 if not self.last_command:

Callers 5

suspendMethod · 0.95
readlineMethod · 0.95
doMethod · 0.45
doMethod · 0.45
showMethod · 0.45

Calls 4

calc_screenMethod · 0.95
restoreMethod · 0.95
do_cmdMethod · 0.95
popMethod · 0.45

Tested by

no test coverage detected