mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
This commit is contained in:
parent
88b8582e45
commit
2618c7fadc
2 changed files with 6 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue