Whole file
berkerpeksag/astor
The author described this change as “Fix trailing newlines in f-strings (#103)”. It counts as a record because the check below fails on the code as it stood at b47718fa0 and passes on 3c4efdb93, with nothing else changed between the two runs.
Projectberkerpeksag/astor
Fix saved2018-05-07
Sharing licenceBSD-3-Clause · LICENSE
Change size+3 −0
What the code was meant to do, written into the code itself as a save note
Fix trailing newlines in f-strings (#103)
The change
| 580 | 580 | ||
| 581 | 581 | index = len(result) | |
| 582 | 582 | recurse(node) | |
| 583 | + | ||
| 584 | + | # Flush trailing newlines (so that they are part of mystr) | |
| 585 | + | self.write('') | |
| 583 | 586 | mystr = ''.join(result[index:]) | |
| 584 | 587 | del result[index:] | |
| 585 | 588 | self.colinfo = res_index, str_index # Put it back like we found it |
The check that tells the two apart
fail→pass·tests/test_code_gen.py::CodegenTestCase::test_fstring_trailing_newline
Check file tests/test_code_gen.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itb47718fa095e456c064d3d222f296fccfe36266b
Broken version dated2018-04-06
Moduleastor.code_gen
Units changedSourceGenerator
Fingerprintb187e8093b5d1c76
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in berkerpeksag/astor
- 2026-02-17add_parens
- 2019-05-12MetaFlatten
- 2019-03-14Fix code generation with escaped braces in f-strings (#125)