[pygtk] PyGtk_FatalExceptions replacement?

Andrew Reid Andrew.Reid at nist.gov
Tue Jan 31 05:55:05 WST 2006


On Mon, Jan 30, 2006 at 07:38:58PM -0200, Johan Dahlin wrote:
> Andrew Reid wrote:

> > [snippage]
> >>    if (args) {
> >>      // Call the Python handler for the configuration event...
> >>      PyObject *result = PyObject_CallObject(config_callback, args);
> >>      if (result==NULL) {
> >>	    if (PyGtk_FatalExceptions) {  // <--- ERROR CHECK IS HERE
> 
> Just calling if (PyErr_Occurred()) should be fine here.

  But it's inside the "if (result==NULL)" -- doesn't that mean
that a Python error has certainly occurred?  My understanding of 
the previous code was that it distinguished between fatal-to-pygtk
exceptions and more benign "ordinary" exceptions in the Python
callback code.

  My recollection of the old code is imperfect, though, and I 
certainly welcome clarification.  I guess it's two questions,
what did the old PyGtk_FatalExceptions flag really indicate,
and is there a pygtk2 equivalent?

				-- A.
  
-- 
Dr. Andrew C. E. Reid, Guest Researcher 
Center for Theoretical and Computational Materials Science
National Institute of Standards and Technology, Mail Stop 8500
Gaithersburg MD 20899 USA
andrew.reid at nist.gov


More information about the pygtk mailing list