summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
authorRoger Serwy <roger.serwy@gmail.com>2013-04-03 03:40:39 (GMT)
committerRoger Serwy <roger.serwy@gmail.com>2013-04-03 03:40:39 (GMT)
commita64a08467077004b0c1ec789d4e6e651e8bdc847 (patch)
treee28770bdb7e447d2fdc1c79a3c1666726c200e5b /Lib/idlelib/PyShell.py
parent207dd387269a95c0406ca211f35bab24948affaa (diff)
parent0d28a61d233c02c458c8b4a25613be2f4979331e (diff)
downloadcpython-a64a08467077004b0c1ec789d4e6e651e8bdc847.zip
cpython-a64a08467077004b0c1ec789d4e6e651e8bdc847.tar.gz
cpython-a64a08467077004b0c1ec789d4e6e651e8bdc847.tar.bz2
#17614: merge with 3.3.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r--Lib/idlelib/PyShell.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index b2a6305..69fd7b0 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -111,12 +111,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"),
@@ -233,6 +234,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