Message359134
Again, I just spent a few minutes looking at this, but in the ttk module, in a similar situation, they do:
if master is None:
if tkinter._support_default_root:
master = tkinter._default_root or tkinter.Tk()
else:
raise RuntimeError(
"No master specified and tkinter is "
"configured to not support default root")
Why not do the same for _QueryDialog in simpledialog.py? Actually, I would also withdraw the root that was just created, because the user doesn't expect this extra window. So, I would replace
if not parent:
parent = tkinter._default_root
with
if parent is None:
if tkinter._default_root:
parent = tkinter._default_root
elif tkinter._support_default_root
parent = tkinter.Tk()
parent.withdraw()
else:
raise RuntimeError(
"No parent specified and tkinter is "
"configured to not support default root")
This tries to get a parent, if possible, and provides a more useful message when no parent can be found, just as in the ttk module in a similar situation. |
|
Date |
User |
Action |
Args |
2019-12-31 22:08:04 | dominic108 | set | recipients:
+ dominic108 |
2019-12-31 22:08:04 | dominic108 | set | messageid: <1577830084.53.0.762687499501.issue39171@roundup.psfhosted.org> |
2019-12-31 22:08:04 | dominic108 | link | issue39171 messages |
2019-12-31 22:08:04 | dominic108 | create | |
|