summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2020-03-09 05:38:07 (GMT)
committerGitHub <noreply@github.com>2020-03-09 05:38:07 (GMT)
commite53a3932cb01683b0fa8a7448ca25a2e658c39e6 (patch)
treef114328c67f68ce4f4f0841ebeed5b00d4f5e7e9 /Lib
parentd7a04a842599c4838a5fdf839842d414a302d7e2 (diff)
downloadcpython-e53a3932cb01683b0fa8a7448ca25a2e658c39e6.zip
cpython-e53a3932cb01683b0fa8a7448ca25a2e658c39e6.tar.gz
cpython-e53a3932cb01683b0fa8a7448ca25a2e658c39e6.tar.bz2
bpo-27115: Move IDLE Query error blanking (GH-18868)
Move required blanking of error text to non-overridden entry_ok(). (Omit news item.)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/query.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py
index 097e6e6..57616de 100644
--- a/Lib/idlelib/query.py
+++ b/Lib/idlelib/query.py
@@ -108,6 +108,7 @@ class Query(Toplevel):
exists=True, root=self.parent)
self.entry_error = Label(frame, text=' ', foreground='red',
font=self.error_font)
+ # Display or blank error by setting ['text'] =.
entrylabel.grid(column=0, row=0, columnspan=3, padx=5, sticky=W)
self.entry.grid(column=0, row=1, columnspan=3, padx=5, sticky=W+E,
pady=[10,0])
@@ -132,7 +133,6 @@ class Query(Toplevel):
def entry_ok(self): # Example: usually replace.
"Return non-blank entry or None."
- self.entry_error['text'] = ''
entry = self.entry.get().strip()
if not entry:
self.showerror('blank line.')
@@ -144,6 +144,7 @@ class Query(Toplevel):
Otherwise leave dialog open for user to correct entry or cancel.
'''
+ self.entry_error['text'] = ''
entry = self.entry_ok()
if entry is not None:
self.result = entry
@@ -173,7 +174,6 @@ class SectionName(Query):
def entry_ok(self):
"Return sensible ConfigParser section name or None."
- self.entry_error['text'] = ''
name = self.entry.get().strip()
if not name:
self.showerror('no name specified.')
@@ -198,7 +198,6 @@ class ModuleName(Query):
def entry_ok(self):
"Return entered module name as file path or None."
- self.entry_error['text'] = ''
name = self.entry.get().strip()
if not name:
self.showerror('no name specified.')
@@ -311,7 +310,6 @@ class HelpSource(Query):
def entry_ok(self):
"Return apparently valid (name, path) or None"
- self.entry_error['text'] = ''
self.path_error['text'] = ''
name = self.item_ok()
path = self.path_ok()
@@ -362,7 +360,6 @@ class CustomRun(Query):
def entry_ok(self):
"Return apparently valid (cli_args, restart) or None"
- self.entry_error['text'] = ''
cli_args = self.cli_args_ok()
restart = self.restartvar.get()
return None if cli_args is None else (cli_args, restart)