summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2008-02-15 21:56:36 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2008-02-15 21:56:36 (GMT)
commite312cfddd363a2ace2a8108927a610387f8e4a50 (patch)
tree25b142ec95c10e6d21e98618af3ecc62ce34756a /Lib/idlelib
parentf67abccf6452098bc5346663cef40eb52af8ba41 (diff)
downloadcpython-e312cfddd363a2ace2a8108927a610387f8e4a50.zip
cpython-e312cfddd363a2ace2a8108927a610387f8e4a50.tar.gz
cpython-e312cfddd363a2ace2a8108927a610387f8e4a50.tar.bz2
ScriptBinding event handlers weren't returning 'break'. Patch 2050, Tal Einat.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/NEWS.txt2
-rw-r--r--Lib/idlelib/ScriptBinding.py13
2 files changed, 9 insertions, 6 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 0326aa7..5b0c012 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -3,6 +3,8 @@ What's New in IDLE 2.6a1?
*Release date: XX-XXX-2008*
+- ScriptBinding event handlers weren't returning 'break'. Patch 2050, Tal Einat.
+
- There was an error on exit if no sys.exitfunc was defined. Issue 1647.
- Could not open files in .idlerc directory if latter was hidden on Windows.
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
index 3746eb8..cb01110 100644
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -56,11 +56,11 @@ class ScriptBinding:
def check_module_event(self, event):
filename = self.getfilename()
if not filename:
- return
+ return 'break'
if not self.checksyntax(filename):
- return
+ return 'break'
if not self.tabnanny(filename):
- return
+ return 'break'
def tabnanny(self, filename):
f = open(filename, 'r')
@@ -136,12 +136,12 @@ class ScriptBinding:
"""
filename = self.getfilename()
if not filename:
- return
+ return 'break'
code = self.checksyntax(filename)
if not code:
- return
+ return 'break'
if not self.tabnanny(filename):
- return
+ return 'break'
shell = self.shell
interp = shell.interp
if PyShell.use_subprocess:
@@ -164,6 +164,7 @@ class ScriptBinding:
# go to __stderr__. With subprocess, they go to the shell.
# Need to change streams in PyShell.ModifiedInterpreter.
interp.runcode(code)
+ return 'break'
def getfilename(self):
"""Get source filename. If not saved, offer to save (or create) file