Message377467
I don't think it's true that the lineno is correct when compiling a string (Remi's string is just too short):
>>> try:
... compile('if __name__ == "__main__":\n print("hello world"\n x=5\n', '<string>', 'exec')
... except SyntaxError as e:
... print("e.lineno=", e.lineno)
... print("e.offset=", e.offset)
... print("e.text=", e.text)
...
e.lineno= 3
e.offset= 4
e.text= x=5
>>>
Arguably the syntax error is on line 3. Line 2 can be complemented by a line 3 that will make it valid. |
|
Date |
User |
Action |
Args |
2020-09-24 23:01:53 | iritkatriel | set | recipients:
+ iritkatriel, zach.ware, remi.lapeyre, timofej |
2020-09-24 23:01:53 | iritkatriel | set | messageid: <1600988513.06.0.0587828137584.issue40813@roundup.psfhosted.org> |
2020-09-24 23:01:53 | iritkatriel | link | issue40813 messages |
2020-09-24 23:01:52 | iritkatriel | create | |
|