pyosys: Clear SIGINT handler after Python loads
authorgatecat <gatecat@ds0.me>
Wed, 16 Jun 2021 11:34:36 +0000 (12:34 +0100)
committergatecat <gatecat@ds0.me>
Wed, 16 Jun 2021 11:34:36 +0000 (12:34 +0100)
Signed-off-by: gatecat <gatecat@ds0.me>
kernel/yosys.cc

index cb6fdc2f49dbc2d18fefa3a41c90422f0afd30d3..f543447bdb508f68b42212e30806dfcff2a16088 100644 (file)
@@ -71,6 +71,7 @@
 
 #include <limits.h>
 #include <errno.h>
+#include <signal.h>
 
 YOSYS_NAMESPACE_BEGIN
 
@@ -540,6 +541,7 @@ void yosys_setup()
                PyImport_AppendInittab((char*)"libyosys", INIT_MODULE);
                Py_Initialize();
                PyRun_SimpleString("import sys");
+               signal(SIGINT, SIG_DFL);
        #endif
 
        Pass::init_register();