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

Method handle_exit

bpython/urwid.py:113–127  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

111 """
112
113 def handle_exit(self, f):
114 def wrapper(*args, **kwargs):
115 try:
116 return f(*args, **kwargs)
117 except urwid.ExitMainLoop:
118 # This is our change.
119 self.reactor.stop()
120 except:
121 # This is the same as in urwid.
122 # We are obviously not supposed to ever hit this.
123 print(sys.exc_info())
124 self._exc_info = sys.exc_info()
125 self.reactor.crash()
126
127 return wrapper
128
129else:
130 TwistedEventLoop = getattr(urwid, "TwistedEventLoop", None)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected