GNOME Bugzilla – Bug 72333
pygtk should handle unix signals
Last modified: 2004-12-22 21:47:04 UTC
Python has a facility to add "pending" calls, which get called as a part of the main interpreter loop. These functions are added with Py_AddPendingCall(). If no python code is being executed, then Py_MakePendingCalls() must be called in order to flush the pending calls. This function returns negative on an exception. Currently, the signal handling code is the only thing I know of that uses this code, but there may be others. The gobject or gtk modules should set up a main loop source that calls python pending calls. This would make the signal module work correctly in pygtk programs.
Looks like PyErr_CheckSignals() is the right one to call.
Tkinter calls PyErr_CheckSignals() once per mainloop iteration (in Tkapp_MainLoop). It also sleeps 20ms between iterations of the mainloop. I suppose the equivalent would be a 20ms timeout function that called PyErr_CheckSignals() then.
*** Bug 96018 has been marked as a duplicate of this bug. ***
Created attachment 12035 [details] [review] Add a timeout add that calls Py_CheckSignals every 100ms in initgtk
mass reassign of open pygtk and gnome-python bugs.
Decided it was a good time fixing this bug now. Committed last patch to CVS