Issue #24137: Run IDLE, test_idle, and htest with tkinter default root disabled.

Fix code and tests that fail with this restriction.
Fix htests to not create a second and redundant root and mainloop.
This commit is contained in:
Terry Jan Reedy 2016-06-21 18:41:38 -04:00
parent aacd53f6cb
commit b60adc54d4
15 changed files with 92 additions and 84 deletions

View file

@ -121,11 +121,11 @@ class VariablesTreeItem(ObjectTreeItem):
return sublist
def _stack_viewer(parent):
root = tk.Tk()
root.title("Test StackViewer")
top = tk.Toplevel(parent)
top.title("Test StackViewer")
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
root.geometry("+%d+%d"%(x, y + 150))
flist = PyShellFileList(root)
top.geometry("+%d+%d"%(x, y + 150))
flist = PyShellFileList(top)
try: # to obtain a traceback object
intentional_name_error
except NameError:
@ -136,7 +136,7 @@ def _stack_viewer(parent):
sys.last_value = exc_value
sys.last_traceback = exc_tb
StackBrowser(root, flist=flist, top=root, tb=exc_tb)
StackBrowser(top, flist=flist, top=top, tb=exc_tb)
# restore sys to original state
del sys.last_type