]> granicus.if.org Git - python/commitdiff
1. Mac line endings were incorrect when pasting code from some browsers
authorKurt B. Kaiser <kbk@shore.net>
Tue, 23 Aug 2005 02:27:23 +0000 (02:27 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Tue, 23 Aug 2005 02:27:23 +0000 (02:27 +0000)
   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

Lib/idlelib/NEWS.txt
Lib/idlelib/ScriptBinding.py

index 3442f40f361b8d1a9b6745e96a4d6579fb513c13..816e138bcc3b8f894c915014a04417cae62b9543 100644 (file)
@@ -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.
index 3e92c802135ad274eb9c724e14ac1fc51ceef825..16fd14dccf4c32c95031f8a62b4efbfe44b854d6 100644 (file)
@@ -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