Redefine builtins 'quit' and 'exit' not so close stdin
(builtins)
| 3 | |
| 4 | |
| 5 | def 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 | |
| 15 | def monkeypatch_quit(): |