This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BTaskaya
Recipients BTaskaya, Ilya Kamenshchikov
Date 2019-12-27.16:27:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1577464021.34.0.556039824622.issue38131@roundup.psfhosted.org>
In-reply-to
Content
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.Num(n=2), op=ast.Add())])
>>> ast.fix_missing_locations(expr_with_lineno_but_with_wrong_body)
>>> compile(expr_without_lineno_but_ok, "<temp>", "eval")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: required field "lineno" missing from expr
>>> compile(expr_with_lineno_but_with_wrong_body, "<temp>", "eval")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: expected some sort of expr, but got [<_ast.BinOp object at 0x7f3f57dc4c80>]
History
Date User Action Args
2019-12-27 16:27:01BTaskayasetrecipients: + BTaskaya, Ilya Kamenshchikov
2019-12-27 16:27:01BTaskayasetmessageid: <1577464021.34.0.556039824622.issue38131@roundup.psfhosted.org>
2019-12-27 16:27:01BTaskayalinkissue38131 messages
2019-12-27 16:27:01BTaskayacreate