After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682014 - Better SIGINT handling for python signals module
Better SIGINT handling for python signals module
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: python
unspecified
Other All
: Normal normal
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-16 15:06 UTC by jessevdk@gmail.com
Modified: 2012-10-12 06:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Better SIGINT handling for python signals module (2.53 KB, patch)
2012-08-16 15:06 UTC, jessevdk@gmail.com
none Details | Review

Description jessevdk@gmail.com 2012-08-16 15:06:30 UTC
Better SIGINT handling for python signals module
    
Even though PyInitialize_Ex does not initialize signal handlers,
the python signal module does install a handler for SIGINT when
the handler for SIGINT is set to SIG_DFL on importing the signal
module.
    
To avoid applications not handling SIGINT we set a custom SIGINT
handler (if the current SIGINT handler is SIG_DFL) before
initializing the python interpreter. This signal handler when
invoked simply chains to the default SIGINT handler.
Comment 1 jessevdk@gmail.com 2012-08-16 15:06:37 UTC
Created attachment 221411 [details] [review]
Better SIGINT handling for python signals module

Even though PyInitialize_Ex does not initialize signal handlers,
the python signal module does install a handler for SIGINT when
the handler for SIGINT is set to SIG_DFL on importing the signal
module.

To avoid applications not handling SIGINT we set a custom SIGINT
handler (if the current SIGINT handler is SIG_DFL) before
initializing the python interpreter. This signal handler when
invoked simply chains to the default SIGINT handler.