"XXX undetected error" in python_d.exe
Tim Peters
tim.one at home.com
Sun Dec 16 00:55:17 EST 2001
[Courageous]
> ...
> In retrospect, this appears to be a case of me not knowing exactly
> when to use the PyErr_Clear() call. This simply _must_ fall into
> the domain of extension authoring esoterica. :-)
The 2.2 docs should be clearer about this, but the bottom-line rules are
simple:
1. Every C API function call capable of an error return must be
checked for an error return.
2. When a C API function call does indicate an error occurred, you
must either pass that error on to your caller, or, if you intend
to ignore the error, you must call PyErr_Clear() before making
another C API function call.
It's best not to think too hard about what those rules imply when a
destructor gets called by magic ...
More information about the Python-list
mailing list