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

Method sigint_handler

bpython/curtsiesfrontend/coderunner.py:170–181  ·  view source on GitHub ↗

SIGINT handler to use while code is running or request being fulfilled

(self, *args)

Source from the content-addressed store, hash-verified

168 raise SystemExitFromCodeRunner(request.args)
169
170 def sigint_handler(self, *args):
171 """SIGINT handler to use while code is running or request being
172 fulfilled"""
173 if greenlet.getcurrent() is self.code_context:
174 logger.debug("sigint while running user code!")
175 raise KeyboardInterrupt()
176 else:
177 logger.debug(
178 "sigint while fulfilling code request sigint handler "
179 "running!"
180 )
181 self.sigint_happened_in_main_context = True
182
183 def _blocking_run_code(self):
184 try:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected