Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def stop(self):
signal.setitimer(signal.ITIMER_REAL, 0.0, 0.0)
try:
signal.signal(signal.SIGALRM, signal.SIG_IGN)
except ValueError:
raise NotMainThreadError()
def __init__(self, message=''):
super(NotMainThreadError, self).__init__(message or NotMainThreadError.__doc__)
def start(self):
try:
signal.signal(signal.SIGALRM, self.signal)
except ValueError:
raise NotMainThreadError()
signal.setitimer(signal.ITIMER_REAL, self.interval, 0.0)
self.last_signal_time = timer()