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
[((110, 161), 'signal.signal', 'signal.signal', (['signal.SIGTERM', 'self._signal_handler'], {}), '(signal.SIGTERM, self._signal_handler)\n', (123, 161), False, 'import signal\n'), ((170, 220), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'self._signal_handler'], {}), '(signal.SIGINT, self._signal_handler)\n', (183, 220), False, 'import signal\n')]