summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/debugobj.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-06-21 22:41:38 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-06-21 22:41:38 (GMT)
commitb60adc54d4f248d71d831d14e11cc77fe72c281e (patch)
tree40991b8eacb5eea9cfe04e7dbb2cb20149b868f2 /Lib/idlelib/debugobj.py
parentaacd53f6cb96fe8c4fe9ce894f22e25f356a97c3 (diff)
downloadcpython-b60adc54d4f248d71d831d14e11cc77fe72c281e.zip
cpython-b60adc54d4f248d71d831d14e11cc77fe72c281e.tar.gz
cpython-b60adc54d4f248d71d831d14e11cc77fe72c281e.tar.bz2
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.
Diffstat (limited to 'Lib/idlelib/debugobj.py')
-rw-r--r--Lib/idlelib/debugobj.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/Lib/idlelib/debugobj.py b/Lib/idlelib/debugobj.py
index 4016c03..0d8b2b2 100644
--- a/Lib/idlelib/debugobj.py
+++ b/Lib/idlelib/debugobj.py
@@ -122,21 +122,20 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
return c(labeltext, object, setfunction)
-def _object_browser(parent):
+def _object_browser(parent): # htest #
import sys
- from tkinter import Tk
- root = Tk()
- root.title("Test debug object browser")
+ from tkinter import Toplevel
+ top = Toplevel(parent)
+ top.title("Test debug object browser")
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
- root.geometry("+%d+%d"%(x, y + 150))
- root.configure(bd=0, bg="yellow")
- root.focus_set()
- sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
+ top.geometry("+%d+%d"%(x + 100, y + 175))
+ top.configure(bd=0, bg="yellow")
+ top.focus_set()
+ sc = ScrolledCanvas(top, bg="white", highlightthickness=0, takefocus=1)
sc.frame.pack(expand=1, fill="both")
item = make_objecttreeitem("sys", sys)
node = TreeNode(sc.canvas, None, item)
node.update()
- root.mainloop()
if __name__ == '__main__':
from idlelib.idle_test.htest import run