MCPcopy Create free account
hub / github.com/FastLED/FastLED / handle_keyboard_interrupt

Function handle_keyboard_interrupt

ci/util/global_interrupt_handler.py:179–189  ·  view source on GitHub ↗

Signal the interrupt and (from a worker thread) wake the main thread. On the main thread: re-raises with ``from ki`` so the exception chain is preserved in tracebacks. On a worker thread: sets the global interrupt flag and wakes the main thread.

(ki: KeyboardInterrupt)

Source from the content-addressed store, hash-verified

177
178
179def handle_keyboard_interrupt(ki: KeyboardInterrupt) -> None:
180 """Signal the interrupt and (from a worker thread) wake the main thread.
181
182 On the main thread: re-raises with ``from ki`` so the exception chain
183 is preserved in tracebacks.
184 On a worker thread: sets the global interrupt flag and wakes the main thread.
185 """
186 _print_caller("handle_keyboard_interrupt")
187 if threading.current_thread() is threading.main_thread():
188 raise KeyboardInterrupt()
189 notify_main_thread()
190
191
192def wait_for_cleanup() -> None:

Callers 15

deadman_timerFunction · 0.90
watchdog_timerFunction · 0.90
_discover_countsFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
run_testsFunction · 0.90
mainFunction · 0.90
compile_wasmFunction · 0.90

Calls 2

_print_callerFunction · 0.85
notify_main_threadFunction · 0.85

Tested by 15

deadman_timerFunction · 0.72
watchdog_timerFunction · 0.72
_discover_countsFunction · 0.72
mainFunction · 0.72
mainFunction · 0.72
run_testsFunction · 0.72
mainFunction · 0.72
mainFunction · 0.72