Some C-API functions clear the error indicator?

Gabriel Genellina gagsl-py2 at
Sat Jan 30 01:11:08 CET 2010

En Fri, 29 Jan 2010 18:25:14 -0300, Austin Bingham  
<austin.bingham at> escribió:

> Maybe I'm not following what you're saying. In my case, I already know
> that an exception has been thrown. In the course of processing that
> exception, I call another function which, for whatever reason and even
> when it succeeds, clears the exception indicators. How can I address
> this issue by checking function calls for failure?

Maybe if you provide an actual use case we can suggest how to handle it.  
The code in your original post does not make any sense to me (except by  
showing that PyImport_ImportModule does clear the error indicator). If you  
already know there was an error, and you even have retrieved the error  
details, why do you care if the error indicator gets reset?

Gabriel Genellina

More information about the Python-list mailing list