bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366)

Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
This commit is contained in:
Terry Jan Reedy 2019-11-24 16:29:29 -05:00 committed by GitHub
parent 6f03b236c1
commit 6bf644ec82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 40 deletions

View file

@ -40,8 +40,9 @@ class Func:
class Editor:
'''Minimally imitate editor.EditorWindow class.
'''
def __init__(self, flist=None, filename=None, key=None, root=None):
self.text = Text()
def __init__(self, flist=None, filename=None, key=None, root=None,
text=None): # Allow real Text with mock Editor.
self.text = text or Text()
self.undo = UndoDelegator()
def get_selection_indices(self):