mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
#17614: IDLE no longer raises exception when quickly closing a file.
This commit is contained in:
parent
c993a19480
commit
d7c9d9cdcd
2 changed files with 7 additions and 1 deletions
|
|
@ -116,12 +116,13 @@ def __init__(self, *args):
|
||||||
self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(),
|
self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(),
|
||||||
'breakpoints.lst')
|
'breakpoints.lst')
|
||||||
# whenever a file is changed, restore breakpoints
|
# whenever a file is changed, restore breakpoints
|
||||||
if self.io.filename: self.restore_file_breaks()
|
|
||||||
def filename_changed_hook(old_hook=self.io.filename_change_hook,
|
def filename_changed_hook(old_hook=self.io.filename_change_hook,
|
||||||
self=self):
|
self=self):
|
||||||
self.restore_file_breaks()
|
self.restore_file_breaks()
|
||||||
old_hook()
|
old_hook()
|
||||||
self.io.set_filename_change_hook(filename_changed_hook)
|
self.io.set_filename_change_hook(filename_changed_hook)
|
||||||
|
if self.io.filename:
|
||||||
|
self.restore_file_breaks()
|
||||||
|
|
||||||
rmenu_specs = [
|
rmenu_specs = [
|
||||||
("Cut", "<<cut>>", "rmenu_check_cut"),
|
("Cut", "<<cut>>", "rmenu_check_cut"),
|
||||||
|
|
@ -237,6 +238,9 @@ def store_file_breaks(self):
|
||||||
|
|
||||||
def restore_file_breaks(self):
|
def restore_file_breaks(self):
|
||||||
self.text.update() # this enables setting "BREAK" tags to be visible
|
self.text.update() # this enables setting "BREAK" tags to be visible
|
||||||
|
if self.io is None:
|
||||||
|
# can happen if IDLE closes due to the .update() call
|
||||||
|
return
|
||||||
filename = self.io.filename
|
filename = self.io.filename
|
||||||
if filename is None:
|
if filename is None:
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #17614: IDLE no longer raises exception when quickly closing a file.
|
||||||
|
|
||||||
- Issue #13163: Rename operands in smtplib.SMTP._get_socket to correct names;
|
- Issue #13163: Rename operands in smtplib.SMTP._get_socket to correct names;
|
||||||
fixes otherwise misleading output in tracebacks and when when debug is on.
|
fixes otherwise misleading output in tracebacks and when when debug is on.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue