Partial fix for #3271 , in particular this makes the script in that issue work.
While there are major issues with the signal handling implementation in libmamba (and the fact that ideally it should be a cancelling system with async high-level functions being cancellable, and then scripts/executables decide how to trigger that cancelling), this only helps if Context.use_default_signal_handler(False) (or the equivalent in C++) is used.
That function had no effect before this PR because the boolean it sets was only taken into account at the construction of the Context instance, which necessarilly must happen before the function can be called. To make it effective I (with the help of @Hind-M ) just made sure that the meaning of the variable is re-applied when the function is set. This might break some usage once called, not sure.
We discussed with @Hind-M and @JohanMabille a future long-term solution for this but it will not come soon so this is the quickest hotfix for now.
Partial fix for #3271 , in particular this makes the script in that issue work.
While there are major issues with the signal handling implementation in libmamba (and the fact that ideally it should be a cancelling system with async high-level functions being cancellable, and then scripts/executables decide how to trigger that cancelling), this only helps if
Context.use_default_signal_handler(False)
(or the equivalent in C++) is used. That function had no effect before this PR because the boolean it sets was only taken into account at the construction of theContext
instance, which necessarilly must happen before the function can be called. To make it effective I (with the help of @Hind-M ) just made sure that the meaning of the variable is re-applied when the function is set. This might break some usage once called, not sure. We discussed with @Hind-M and @JohanMabille a future long-term solution for this but it will not come soon so this is the quickest hotfix for now.