MCPcopy Create free account
hub / github.com/bpython/bpython / resetquit

Function resetquit

bpython/curtsiesfrontend/sitefix.py:5–12  ·  view source on GitHub ↗

Redefine builtins 'quit' and 'exit' not so close stdin

(builtins)

Source from the content-addressed store, hash-verified

3
4
5def resetquit(builtins):
6 """Redefine builtins 'quit' and 'exit' not so close stdin"""
7
8 def __call__(self, code=None):
9 raise SystemExit(code)
10
11 __call__.__name__ = "FakeQuitCall"
12 builtins.quit.__class__.__call__ = __call__
13
14
15def monkeypatch_quit():

Callers 1

monkeypatch_quitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected