sys.exit after keyboard interrupt
Summary
Any code after drain is executed even when a keyboard interrupt occurred during the drain. Example:
import km3pipe as kp
from time import sleep
class WaitModule(kp.Module):
def process(self, blob):
print('Press Ctrl+C')
sleep(1)
return blob
pipe = kp.Pipeline()
pipe.attach(WaitModule)
pipe.drain()
print('This get\'s executed!')
Suggestion
Either call sys.exit or similar after every module finished after a keyboard interrupt or add a flag to the Pipeline class indicating that a keyboard interrupt appeared.