Message210304
I put the try/except outside of the loop on purpose. If calling the widget's unbind() method fails once, it will fail forever afterwards.
If you prefer a different spelling, move the try/except into the loop, and break out of the loop in case of an exception:
for seq, id in self.handlerids:
try:
self.widget.unbind(self.widgetinst, seq, id)
except _tkinter.TclError:
break
As for avoiding the exception in the first place, I'm sure figuring out how IDLE shuts down would be a lot of work, and I honestly don't think it's necessary. Note that this problem is triggered in a __del__() method; making sure these are called at a proper time is problematic because the timing depends on the GC. |
|
Date |
User |
Action |
Args |
2014-02-05 11:43:38 | taleinat | set | recipients:
+ taleinat, terry.reedy, kbk, roger.serwy, serhiy.storchaka |
2014-02-05 11:43:38 | taleinat | set | messageid: <1391600618.2.0.0110312936043.issue20167@psf.upfronthosting.co.za> |
2014-02-05 11:43:38 | taleinat | link | issue20167 messages |
2014-02-05 11:43:38 | taleinat | create | |
|