Weird ttk behaviour

Chris Angelico rosuav at gmail.com
Tue Sep 17 07:32:55 EDT 2013


On Tue, Sep 17, 2013 at 9:27 PM, Rotwang <sg552 at hotmail.co.uk> wrote:
> On 16/09/2013 23:34, Chris Angelico wrote:
>>
>> On Tue, Sep 17, 2013 at 2:28 AM, Rotwang <sg552 at hotmail.co.uk> wrote:
>>>
>>> If I then uncomment those two lines, reload the module and call f() again
>>> (by entering tkderp.reload(tkderp).f()), the function works like it was
>>> supposed to in the first place: two warnings, no exceptions. I can reload
>>> the module as many times as I like and f() will continue to work without
>>> any
>>> problems.
>>
>>
>> Reloading modules in Python is a bit messy. Are you able to tinker
>> with it and make it work in some way without reloading? It'd be easier
>> to figure out what's going on that way.
>
>
> I can't think what else I could try, do you have any suggestions? The
> problem first appeared in a much larger module (I was trying to replace some
> tkinter widgets that looked bad on Linux with their ttk equivalents); the
> only reason I noticed the thing about reloading is that I was trying to
> reproduce the error in a short module by repeatedly making changes and
> reloading.

If reloading and doing it again makes things different, what happens
if you simply trigger your code twice without reloading?

I've no idea if it'll help, it just seems like an attack vector on the
problem, so to speak.

ChrisA



More information about the Python-list mailing list