Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_kbi_safe_yaspin():
sp = kbi_safe_yaspin()
try:
sp.start()
handler = signal.getsignal(signal.SIGINT)
# Handler function is wrapped into ``partial`` and
# is accesible via ``func`` attribute.
assert handler.func == sp._sigmap[signal.SIGINT]
finally:
sp.stop()
def simple_keyboard_interrupt_handling():
with kbi_safe_yaspin(text=DEFAULT_TEXT):
time.sleep(5)