Skip to content

Commit

Permalink
Update signal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
anki-code authored Jun 10, 2024
1 parent 3b6db49 commit 0abe95a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions xontrib/macro/signal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import signal

class DisableInterruptCM:
class DisableInterrupt:
def __enter__(self):
self.handler_called = False
self.original_handler = signal.getsignal(signal.SIGINT)
Expand All @@ -17,6 +17,3 @@ def __exit__(self, exc_type, exc_value, traceback):
signal.signal(signal.SIGINT, self.original_handler)
if self.handler_called:
raise KeyboardInterrupt("KeyboardInterrupt was received during transaction.")


DisableInterrupt = DisableInterruptCM()

0 comments on commit 0abe95a

Please sign in to comment.