[Python-checkins] cpython (merge 3.4 -> default): Merge with 3.4

terry.reedy python-checkins at python.org
Fri Oct 10 05:14:13 CEST 2014


https://hg.python.org/cpython/rev/a1cc4540ed0d
changeset:   92908:a1cc4540ed0d
parent:      92905:b04b7af14910
parent:      92907:ce0316007b21
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Thu Oct 09 23:13:54 2014 -0400
summary:
  Merge with 3.4

files:
  Lib/idlelib/MultiCall.py |  15 ++++-----------
  1 files changed, 4 insertions(+), 11 deletions(-)


diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -60,8 +60,7 @@
 # destroyed before .__del__ methods here are called.  The following
 # is used to selectively ignore shutdown exceptions to avoid
 # 'Exception ignored' messages.  See http://bugs.python.org/issue20167
-APPLICATION_GONE = '''\
-can't invoke "bind" command:  application has been destroyed'''
+APPLICATION_GONE = "application has been destroyed"
 
 # A binder is a class which binds functions to one type of event. It has two
 # methods: bind and unbind, which get a function and a parsed sequence, as
@@ -108,9 +107,7 @@
                 self.widget.unbind(self.widgetinst, self.sequence,
                         self.handlerid)
             except tkinter.TclError as e:
-                if e.args[0] == APPLICATION_GONE:
-                    pass
-                else:
+                if not APPLICATION_GONE in e.args[0]:
                     raise
 
 # An int in range(1 << len(_modifiers)) represents a combination of modifiers
@@ -243,9 +240,7 @@
             try:
                 self.widget.unbind(self.widgetinst, seq, id)
             except tkinter.TclError as e:
-                if e.args[0] == APPLICATION_GONE:
-                    break
-                else:
+                if not APPLICATION_GONE in e.args[0]:
                     raise
 
 # define the list of event types to be handled by MultiEvent. the order is
@@ -412,9 +407,7 @@
                         try:
                             self.__binders[triplet[1]].unbind(triplet, func)
                         except tkinter.TclError as e:
-                            if e.args[0] == APPLICATION_GONE:
-                                break
-                            else:
+                            if not APPLICATION_GONE in e.args[0]:
                                 raise
 
     _multicall_dict[widget] = MultiCall

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list