[PyQt] Qt Exception Translation in Signal Handlers

Aron Bierbaum aronbierbaum at gmail.com
Mon Mar 14 14:20:17 GMT 2011


I guess I don't see how setting a custom sys.excepthook will help me in this
case. I would like the exception that is raised to be recognized as a test
failure. The best that I could do is add some sort of a hack that attempts
to manually inject the error into the currently running test in a custom
sys.excepthook. Are there any other potential methods of accomplishing this?

Thanks,
Aron

On Sun, Mar 13, 2011 at 5:15 AM, Phil Thompson
<phil at riverbankcomputing.com>wrote:

> On Sun, 6 Mar 2011 20:04:17 -0600, Aron Bierbaum <aronbierbaum at gmail.com>
> wrote:
> > I have attached a sample test suite that shows an issue that we are
> running
> > into. The basic issue is that if an exception is raised in a method that
> is
> > connected to a Qt signal, the exception is only printed. I know that
> > translating the exception from Python to C++ and then back into Python
> is
> > difficult. But as the example shows the test suite can ignore real test
> > failures. Is there some way that PyQt could be changed to at least
> > translate
> > the exception type that can pass through C++ and back into Python?
> >
> > Thanks,
> > Aron
>
> The normal technique is to use sys.excepthook.
>
> Phil
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110314/7bedcdab/attachment.html>


More information about the PyQt mailing list