Message313178
To be clear, the signature that got changed in 2005 is the signature for find_good_parse_start ('fgps'), which was previously
def find_good_parse_start(self, use_ps1, is_char_in_string=None,
_synchre=_synchre)
When the use_ps1 parameter was removed, the 'if use_ps1' code was moved to the else: branch of the new 'if not use_ps1: ... else: ' in the editor method, but the call in question, moved into the 'if not use_ps1' branch, was not changed. The immediate fix is to remove the extra argument.
The similar call in the then new hyperparser module is correct.
bod = parser.find_good_parse_start(
editwin._build_char_in_string_func(startatindex))
The erroneous call has not been detected in execution because of this bug:
not is_char_in_string
is too general. It should have been specifically
is_char_in_string is None
so False does not trigger the early return, but gets called, raising TypeError. We should add a test that find_good_parse_start(False, lambda: True) does so, with reference to this issue.
Both calls to fgps (editor and hyperparser) pass _build_char_in_string_func(initial_start), which unconditionally returns a function. So I think we can delete '=None' and the early return, rather than changing the early return condition. |
|
| Date |
User |
Action |
Args |
| 2018-03-03 03:56:57 | terry.reedy | set | recipients:
+ terry.reedy, cheryl.sabella |
| 2018-03-03 03:56:57 | terry.reedy | set | messageid: <[email protected]> |
| 2018-03-03 03:56:57 | terry.reedy | link | issue32989 messages |
| 2018-03-03 03:56:57 | terry.reedy | create | |
|