Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4fe69ba

Browse files
committed
Issue #20167: revise condition to accomodate message change.
1 parent 5f16f90 commit 4fe69ba

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

Lib/idlelib/MultiCall.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
# destroyed before .__del__ methods here are called. The following
6161
# is used to selectively ignore shutdown exceptions to avoid
6262
# 'Exception ignored' messages. See http://bugs.python.org/issue20167
63-
APPLICATION_GONE = '''\
64-
can't invoke "bind" command: application has been destroyed'''
63+
APPLICATION_GONE = "application has been destroyed"
6564

6665
# A binder is a class which binds functions to one type of event. It has two
6766
# methods: bind and unbind, which get a function and a parsed sequence, as
@@ -108,9 +107,7 @@ def __del__(self):
108107
self.widget.unbind(self.widgetinst, self.sequence,
109108
self.handlerid)
110109
except tkinter.TclError as e:
111-
if e.args[0] == APPLICATION_GONE:
112-
pass
113-
else:
110+
if not APPLICATION_GONE in e.args[0]:
114111
raise
115112

116113
# An int in range(1 << len(_modifiers)) represents a combination of modifiers
@@ -243,9 +240,7 @@ def __del__(self):
243240
try:
244241
self.widget.unbind(self.widgetinst, seq, id)
245242
except tkinter.TclError as e:
246-
if e.args[0] == APPLICATION_GONE:
247-
break
248-
else:
243+
if not APPLICATION_GONE in e.args[0]:
249244
raise
250245

251246
# define the list of event types to be handled by MultiEvent. the order is
@@ -412,9 +407,7 @@ def __del__(self):
412407
try:
413408
self.__binders[triplet[1]].unbind(triplet, func)
414409
except tkinter.TclError as e:
415-
if e.args[0] == APPLICATION_GONE:
416-
break
417-
else:
410+
if not APPLICATION_GONE in e.args[0]:
418411
raise
419412

420413
_multicall_dict[widget] = MultiCall

0 commit comments

Comments
 (0)