import signal


class KillableProcess(object):
    def __init__(self):
        self.interrupt = False
        signal.signal(signal.SIGTERM, self._signal_handler)
        signal.signal(signal.SIGINT, self._signal_handler)

    def _signal_handler(self, sign, frame):
        self.interrupt = True
[((7, 8, 7, 59), 'signal.signal', 'signal.signal', ({(7, 22, 7, 36): 'signal.SIGTERM', (7, 38, 7, 58): 'self._signal_handler'}, {}), '(signal.SIGTERM, self._signal_handler)', False, 'import signal\n'), ((8, 8, 8, 58), 'signal.signal', 'signal.signal', ({(8, 22, 8, 35): 'signal.SIGINT', (8, 37, 8, 57): 'self._signal_handler'}, {}), '(signal.SIGINT, self._signal_handler)', False, 'import signal\n')]