Proper ctrl+c support in python module.