mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
One happens when EditorWindow.close is called twice.
Printing a traceback, when IDLE is run from a terminal,
is useless and annoying.
(cherry picked from commit dfd34a9cd5
)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
f04299d978
commit
73ccc3322f
3 changed files with 17 additions and 4 deletions
|
@ -1061,10 +1061,13 @@ class EditorWindow(object):
|
|||
return self.io.maybesave()
|
||||
|
||||
def close(self):
|
||||
reply = self.maybesave()
|
||||
if str(reply) != "cancel":
|
||||
self._close()
|
||||
return reply
|
||||
try:
|
||||
reply = self.maybesave()
|
||||
if str(reply) != "cancel":
|
||||
self._close()
|
||||
return reply
|
||||
except AttributeError: # bpo-35379: close called twice
|
||||
pass
|
||||
|
||||
def _close(self):
|
||||
if self.io.filename:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue