MCPcopy
hub / github.com/prompt-toolkit/ptpython / exit

Class exit

src/ptpython/repl.py:495–509  ·  view source on GitHub ↗

Exit the ptpython REPL.

Source from the content-addressed store, hash-verified

493
494
495class exit:
496 """
497 Exit the ptpython REPL.
498 """
499
500 # This custom exit function ensures that the `embed` function returns from
501 # where we are embedded, and Python doesn't close `sys.stdin` like
502 # the default `exit` from `_sitebuiltins.Quitter` does.
503
504 def __call__(self) -> NoReturn:
505 raise ReplExit
506
507 def __repr__(self) -> str:
508 # (Same message as the built-in Python REPL.)
509 return "Use exit() or Ctrl-D (i.e. EOF) to exit"
510
511
512class ReplExit(Exception):

Callers 1

_add_to_namespaceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected