summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt B. Kaiser <kbk@shore.net>2005-08-23 02:27:23 (GMT)
committerKurt B. Kaiser <kbk@shore.net>2005-08-23 02:27:23 (GMT)
commit2618c7fadc756ebd81213423055626411920f379 (patch)
treea50d2bee0877906b9dd23c046d04502362324957
parent88b8582e45c220c55a9c497c899687068958e99a (diff)
downloadcpython-2618c7fadc756ebd81213423055626411920f379.zip
cpython-2618c7fadc756ebd81213423055626411920f379.tar.gz
cpython-2618c7fadc756ebd81213423055626411920f379.tar.bz2
1. Mac line endings were incorrect when pasting code from some browsers
when using X11 and the Fink distribution. Python Bug 1263656. 2. Eliminate duplicated code in ScriptBinding.run_module_event() Modified Files: NEWS.txt ScriptBinding.py
-rw-r--r--Lib/idlelib/NEWS.txt3
-rw-r--r--Lib/idlelib/ScriptBinding.py10
2 files changed, 6 insertions, 7 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 3442f40..816e138 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -3,6 +3,9 @@ What's New in IDLE 1.2a0?
*Release date: XX-XXX-2005*
+- Mac line endings were incorrect when pasting code from some browsers
+ when using X11 and the Fink distribution. Python Bug 1263656.
+
- <Enter> when cursor is on a previous command retrieves that command. Instead
of replacing the input line, the previous command is now appended to the
input line. Indentation is preserved, and undo is enabled.
diff --git a/Lib/idlelib/ScriptBinding.py b/Lib/idlelib/ScriptBinding.py
index 3e92c80..16fd14d 100644
--- a/Lib/idlelib/ScriptBinding.py
+++ b/Lib/idlelib/ScriptBinding.py
@@ -53,7 +53,7 @@ class ScriptBinding:
self.flist = self.editwin.flist
self.root = self.flist.root
- def check_module_event(self, event):
+ def check_module_event(self, event=None):
filename = self.getfilename()
if not filename:
return
@@ -87,6 +87,7 @@ class ScriptBinding:
f.close()
if '\r' in source:
source = re.sub(r"\r\n", "\n", source)
+ source = re.sub(r"\r", "\n", source)
if source and source[-1] != '\n':
source = source + '\n'
text = self.editwin.text
@@ -132,12 +133,7 @@ class ScriptBinding:
add that directory to its sys.path if not already included.
"""
- filename = self.getfilename()
- if not filename:
- return
- if not self.tabnanny(filename):
- return
- code = self.checksyntax(filename)
+ code = self.check_module_event(event)
if not code:
return
shell = self.shell