bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)
Fix comments and add tests for editor newline_and_indent_event method.
Remove unused None default for function parameter of pyparse find_good_parse_start method
and code triggered by that default.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py
index feb57cb..9fa2010 100644
--- a/Lib/idlelib/pyparse.py
+++ b/Lib/idlelib/pyparse.py
@@ -133,8 +133,7 @@
self.code = s
self.study_level = 0
- def find_good_parse_start(self, is_char_in_string=None,
- _synchre=_synchre):
+ def find_good_parse_start(self, is_char_in_string, _synchre=_synchre):
"""
Return index of a good place to begin parsing, as close to the
end of the string as possible. This will be the start of some
@@ -149,10 +148,6 @@
"""
code, pos = self.code, None
- if not is_char_in_string:
- # no clue -- make the caller pass everything
- return None
-
# Peek back from the end for a good place to start,
# but don't try too often; pos will be left None, or
# bumped to a legitimate synch point.