diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2005-08-23 02:27:23 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2005-08-23 02:27:23 (GMT) |
commit | 2618c7fadc756ebd81213423055626411920f379 (patch) | |
tree | a50d2bee0877906b9dd23c046d04502362324957 /Lib/idlelib/ScriptBinding.py | |
parent | 88b8582e45c220c55a9c497c899687068958e99a (diff) | |
download | cpython-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
Diffstat (limited to 'Lib/idlelib/ScriptBinding.py')
-rw-r--r-- | Lib/idlelib/ScriptBinding.py | 10 |
1 files changed, 3 insertions, 7 deletions
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 |