[Python-checkins] bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
Miss Islington (bot)
webhook-mailer at python.org
Thu Aug 2 03:52:28 EDT 2018
https://github.com/python/cpython/commit/60586de02de074a33c015e5a013d85d0b17e7e61
commit: 60586de02de074a33c015e5a013d85d0b17e7e61
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-08-02T00:52:22-07:00
summary:
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
(cherry picked from commit dd74369cb7b230b07ac3a031563406c8f2aae17f)
Co-authored-by: Tal Einat <taleinat+github at gmail.com>
files:
M Lib/idlelib/textview.py
diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py
index e78e297ab993..75b24703b4c3 100644
--- a/Lib/idlelib/textview.py
+++ b/Lib/idlelib/textview.py
@@ -83,7 +83,8 @@ def __init__(self, parent, title, text, modal=True,
command=self.ok, takefocus=False)
self.viewframe.pack(side='top', expand=True, fill='both')
- if modal:
+ self.is_modal = modal
+ if self.is_modal:
self.transient(parent)
self.grab_set()
if not _utest:
@@ -91,7 +92,8 @@ def __init__(self, parent, title, text, modal=True,
def ok(self, event=None):
"""Dismiss text viewer dialog."""
- self.grab_release()
+ if self.is_modal:
+ self.grab_release()
self.destroy()
More information about the Python-checkins
mailing list