Message370316
Indeed, the exception has the correct line number when compiling manually:
>>> try:
... compile('if __name__ == "__main__":\n print("hello world"\n', '<string>', 'exec')
... except SyntaxError as e:
... print(e.lineno)
...
2
but not when running `python3 main.py`:
File "main.py", line 3
^
SyntaxError: unexpected EOF while parsing
I tried with all version of Python >= 3.6 and Python2 and they all exhibit the same behavior. |
|
Date |
User |
Action |
Args |
2020-05-29 14:43:20 | remi.lapeyre | set | recipients:
+ remi.lapeyre, zach.ware, timofej |
2020-05-29 14:43:20 | remi.lapeyre | set | messageid: <1590763400.32.0.769986654169.issue40813@roundup.psfhosted.org> |
2020-05-29 14:43:20 | remi.lapeyre | link | issue40813 messages |
2020-05-29 14:43:20 | remi.lapeyre | create | |
|