From b60adc54d4f248d71d831d14e11cc77fe72c281e Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 21 Jun 2016 18:41:38 -0400 Subject: 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. --- Lib/idlelib/stackviewer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Lib/idlelib/stackviewer.py') diff --git a/Lib/idlelib/stackviewer.py b/Lib/idlelib/stackviewer.py index 87c964e7af..b3b99bcefd 100644 --- a/Lib/idlelib/stackviewer.py +++ b/Lib/idlelib/stackviewer.py @@ -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 -- cgit v1.2.1