Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CTRL-C causes forrtl: error (200) rather than python KeyboardInterrupt exception

I'm trying to do the exact same thing as this question:

How to prevent a block of code from being interrupted by KeyboardInterrupt in Python? (sorry, not enough rep yet to post this as a comment there)

However both of the top answers posted there aren't working for me. When I hit CTRL+C with either of those solutions in place, the script still closes immediately with:

forrtl: error (200): program aborting due to control-C event

The code I'm working on is fairly long and includes quite a few imported modules. Am I correct to assume one of these modules is interfering with the normal behavior of KeyboardInterrupt? If so, how can I figure out which one?

(I'm running python 2.7.6, 32bit on Windows)

thanks.

like image 927
tfg250 Avatar asked Mar 07 '17 16:03

tfg250


1 Answers

Scipy was causing the problem. The link below provides a solution, note that this is not unique to scipy.stats, but also occurs with other scipy functions.

Ctrl-C crashes Python after importing scipy.stats

like image 62
tfg250 Avatar answered Nov 01 '22 20:11

tfg250