Message368598
Seem to not be in the new parser but simply in codeop in particular `def _maybe_compile`
The logic seem weird (but weird logic usually have a reason), it try to compile thrice by appending many `\n`.
1) Why do that and not return the first successful compile directly ? I'm not sure.
2) It does compare the repr of error when compile(source + "\n") and compile(source+'\n\n') and only raise if both are identical (which they are not in the new parser, they differ by `\n`...)
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b'))
vs
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b\n'))
This logic seem to go back to the 2000s. |
|
Date |
User |
Action |
Args |
2020-05-10 23:44:03 | mbussonn | set | recipients:
+ mbussonn, gvanrossum, ned.deily, serhiy.storchaka, Anthony Sottile, lys.nikolaou, pablogsal, BTaskaya, hauntsaninja |
2020-05-10 23:44:03 | mbussonn | set | messageid: <1589154243.07.0.470353106947.issue40334@roundup.psfhosted.org> |
2020-05-10 23:44:03 | mbussonn | link | issue40334 messages |
2020-05-10 23:44:02 | mbussonn | create | |
|