bpo-12611: 2to3 crashes when converting doctest using reduce() by aldwinaldwin · Pull Request #15249 · python/cpython
| new = str(tree).splitlines(keepends=True) | ||
| # Adjust lineno for lines inserted before | ||
| jmp = 0 | ||
| for n in new: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO
This logic can be replaced by
jmp = max(new.index('\n'), 0)
| @@ -0,0 +1 @@ | |||
| 2to3 converting doctest using reduce(). Patch by Aldwin Pollefeyt. | |||
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2to3 converting doctest using reduce(). Patch by Aldwin Pollefeyt. | |
| Fix 2to3 crashing when run on a doctest that uses reduce(). Patch by Aldwin Pollefeyt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters