[issue38131] compile(mode='eval') uninformative error message

2020-05-07 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: I've updated PR 17715 in order to point out exact field that error happened. Also it now only shows type >>> import ast >>> expr_without_lineno_but_ok = >>> ast.Expression(body=ast.BinOp(left=ast.Num(n=2), right=ast.Num(n=2), >>> op=ast.Add())) >>> expr_wi

[issue38131] compile(mode='eval') uninformative error message

2020-02-14 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +benjamin.peterson, pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue38131] compile(mode='eval') uninformative error message

2019-12-27 Thread Batuhan
Change by Batuhan : -- components: +Interpreter Core -Library (Lib) nosy: +BTaskaya versions: +Python 3.9 -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___

[issue38131] compile(mode='eval') uninformative error message

2019-12-27 Thread Batuhan
Batuhan added the comment: with PR 17715 >>> import ast >>> expr_without_lineno_but_ok = >>> ast.Expression(body=ast.BinOp(left=ast.Num(n=2), right=ast.Num(n=2), >>> op=ast.Add())) >>> expr_with_lineno_but_with_wrong_body = >>> ast.Expression(body=[ast.BinOp(left=ast.Num(n=2), right=ast.Nu

[issue38131] compile(mode='eval') uninformative error message

2019-12-27 Thread Batuhan
Change by Batuhan : -- keywords: +patch pull_requests: +17160 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17715 ___ Python tracker ___

[issue38131] compile(mode='eval') uninformative error message

2019-09-12 Thread Ilya Kamenshchikov
New submission from Ilya Kamenshchikov : While trying to construct a valid ast node programmatically, I have tried following: import ast tree = ast.BinOp(left=ast.Num(n=2), right=ast.Num(n=2), op=ast.Add()) expr = ast.Expression(body=[tree]) ast.fix_missing_locations(expr) exe = compile(expr