diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-06-21 22:41:38 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-06-21 22:41:38 (GMT) |
commit | b60adc54d4f248d71d831d14e11cc77fe72c281e (patch) | |
tree | 40991b8eacb5eea9cfe04e7dbb2cb20149b868f2 /Lib/idlelib/undo.py | |
parent | aacd53f6cb96fe8c4fe9ce894f22e25f356a97c3 (diff) | |
download | cpython-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/undo.py')
-rw-r--r-- | Lib/idlelib/undo.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/idlelib/undo.py b/Lib/idlelib/undo.py index 3e94b69..ccc962a 100644 --- a/Lib/idlelib/undo.py +++ b/Lib/idlelib/undo.py @@ -1,7 +1,7 @@ import string -from tkinter import * - from idlelib.delegator import Delegator +# tkintter import not needed because module does not create widgets, +# although many methods operate on text widget arguments. #$ event <<redo>> #$ win <Control-y> @@ -339,12 +339,12 @@ class CommandSequence(Command): def _undo_delegator(parent): # htest # import re - import tkinter as tk + from tkinter import Toplevel, Text, Button from idlelib.percolator import Percolator - undowin = tk.Toplevel() + undowin = Toplevel(parent) undowin.title("Test UndoDelegator") width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) - undowin.geometry("+%d+%d"%(x, y + 150)) + undowin.geometry("+%d+%d"%(x, y + 175)) text = Text(undowin, height=10) text.pack() @@ -362,7 +362,7 @@ def _undo_delegator(parent): # htest # if __name__ == "__main__": import unittest - unittest.main('idlelib.idle_test.test_undodelegator', verbosity=2, + unittest.main('idlelib.idle_test.test_undo', verbosity=2, exit=False) from idlelib.idle_test.htest import run run(_undo_delegator) |