From 17937832badd5cd97967ccc1fff3b4b45feeaba9 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 25 Jul 2016 20:58:43 -0400 Subject: [PATCH] Issue #27620: Escape key closes Query box as cancelled. --- Lib/idlelib/idle_test/htest.py | 6 +++--- Lib/idlelib/query.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py index 4d98924d9b..c59ed8c88e 100644 --- a/Lib/idlelib/idle_test/htest.py +++ b/Lib/idlelib/idle_test/htest.py @@ -175,8 +175,8 @@ HelpSource_spec = { "'' and file does not exist are invalid path items.\n" "Any url ('www...', 'http...') is accepted.\n" "Test Browse with and without path, as cannot unittest.\n" - "A valid entry will be printed to shell with [0k]\n" - "or . [Cancel] will print None to shell" + "[Ok] or prints valid entry to shell\n" + "[Cancel] or prints None to shell" } _io_binding_spec = { @@ -245,7 +245,7 @@ Query_spec = { '_htest': True}, 'msg': "Enter with or [Ok]. Print valid entry to Shell\n" "Blank line, after stripping, is ignored\n" - "Close dialog with valid entry, [Cancel] or [X]" + "Close dialog with valid entry, , [Cancel], [X]" } diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index d2d1472a0e..c4e2891f25 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -53,6 +53,7 @@ class Query(Toplevel): self.transient(parent) self.grab_set() self.bind('', self.ok) + self.bind('', self.cancel) self.protocol("WM_DELETE_WINDOW", self.cancel) self.parent = parent self.message = message -- 2.40.0