diff options
author | Roger Serwy <roger.serwy@gmail.com> | 2013-04-03 03:37:12 (GMT) |
---|---|---|
committer | Roger Serwy <roger.serwy@gmail.com> | 2013-04-03 03:37:12 (GMT) |
commit | d7c9d9cdcdc179a0c9a458c70f814cd9db024e5d (patch) | |
tree | 4570f82c90ac474a97859044b4d9e53dc5e19e8d /Lib | |
parent | c993a1948043af043bec8e8230abd68200a863b1 (diff) | |
download | cpython-d7c9d9cdcdc179a0c9a458c70f814cd9db024e5d.zip cpython-d7c9d9cdcdc179a0c9a458c70f814cd9db024e5d.tar.gz cpython-d7c9d9cdcdc179a0c9a458c70f814cd9db024e5d.tar.bz2 |
#17614: IDLE no longer raises exception when quickly closing a file.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/PyShell.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index f2c9062..d144a51 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -116,12 +116,13 @@ class PyShellEditorWindow(EditorWindow): self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(), 'breakpoints.lst') # 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, self=self): self.restore_file_breaks() old_hook() self.io.set_filename_change_hook(filename_changed_hook) + if self.io.filename: + self.restore_file_breaks() rmenu_specs = [ ("Cut", "<<cut>>", "rmenu_check_cut"), @@ -237,6 +238,9 @@ class PyShellEditorWindow(EditorWindow): def restore_file_breaks(self): 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 if filename is None: return |