[PyQt] Any way to run code before each QThread?

Ned Batchelder ned at nedbatchelder.com
Mon Jul 16 13:13:00 BST 2018


On 7/15/18 12:06 PM, Florian Bruhin wrote:
> On Sun, Jul 15, 2018 at 05:57:29PM +0200, Tobias Rzepka wrote:
>> Have a look into the Eric debugger. I've already implemented a solution to intercept the QThread creation and to inject code to trace the excecution.
> That seemes to be here:
> http://die-offenbachs.homelinux.org:48888/hg/eric/file/87b1626eb49b/DebugClients/Python/ThreadExtension.py#l361
> and just patches the QThread class.
>
> Not sure if that's possible for coverage to do (as it doesn't implement
> its own module loading hook, afaik). It definitely gets the
> "hacky^H^H^H^H^Hcreative idea" badge, though :D
>

Hmm, coverage.py doesn't (yet) have a module loading hook.  I wonder if 
it should?

--Ned.


More information about the PyQt mailing list