[PyQt] Exceptions and stack frames

Jeremy Sanders jeremy at jeremysanders.net
Fri Aug 20 10:18:46 BST 2010


Phil Thompson wrote:

> Isn't this the normal behaviour? The stack frame is part of the traceback
> of the exception. It will stay around until it is replaced by another
> exception.
> 
> If you add a second button to the first dialog that also raises an
> exception, you should see that the __del__ method is called when the
> second exception is raised. There should only ever be one stack frame
> hanging around.

Sorry - I had no idea this was the normal behaviour - I missed this in the 
Python docs.

I've worked around my problem by raising a special exception in the 
exception handler after handling the first, then ignoring it - urgh.

I tried using exc_clear() instead, but this doesn't seem to have any effect.

I noticed this problem because Python signals seem to continue to be 
connected to a QObject even if the Qt part has been deleted, unlike C++ 
signals.

Jeremy

-- 
http://www.jeremysanders.net/



More information about the PyQt mailing list