summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test/mock_idle.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2019-11-24 21:29:29 (GMT)
committerGitHub <noreply@github.com>2019-11-24 21:29:29 (GMT)
commit6bf644ec82f14cceae68278dc35bafb00875efae (patch)
tree79a913bdabfec4c9d3c30ec112f185336ce34eb0 /Lib/idlelib/idle_test/mock_idle.py
parent6f03b236c17c96bc9f8a004ffa7e7ae0542e9cac (diff)
downloadcpython-6bf644ec82f14cceae68278dc35bafb00875efae.zip
cpython-6bf644ec82f14cceae68278dc35bafb00875efae.tar.gz
cpython-6bf644ec82f14cceae68278dc35bafb00875efae.tar.bz2
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.
Diffstat (limited to 'Lib/idlelib/idle_test/mock_idle.py')
-rw-r--r--Lib/idlelib/idle_test/mock_idle.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/idlelib/idle_test/mock_idle.py b/Lib/idlelib/idle_test/mock_idle.py
index f279a52..71fa480 100644
--- a/Lib/idlelib/idle_test/mock_idle.py
+++ b/Lib/idlelib/idle_test/mock_idle.py
@@ -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):