File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,9 @@ pub(crate) mod _signal {
103103 . clone ( )
104104 . get_attr ( "default_int_handler" , vm)
105105 . expect ( "_signal does not have this attr?" ) ;
106- signal ( libc:: SIGINT , int_handler, vm) . expect ( "Failed to set sigint handler" ) ;
106+ if !vm. state . settings . no_sig_int {
107+ signal ( libc:: SIGINT , int_handler, vm) . expect ( "Failed to set sigint handler" ) ;
108+ }
107109 }
108110
109111 #[ pyfunction]
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ pub struct Settings {
1616 /// -O optimization switch counter
1717 pub optimize : u8 ,
1818
19+ /// Not set SIGINT handler(i.e. for embedded mode)
20+ pub no_sig_int : bool ,
21+
1922 /// -s
2023 pub no_user_site : bool ,
2124
@@ -85,6 +88,7 @@ impl Default for Settings {
8588 inspect : false ,
8689 interactive : false ,
8790 optimize : 0 ,
91+ no_sig_int : false ,
8892 no_user_site : false ,
8993 no_site : false ,
9094 ignore_environment : false ,
You can’t perform that action at this time.
0 commit comments