Message364505
When something that isn't constant found in a ast.Constant node's body, python reports errors like this
>>> e = ast.Expression(body=ast.Constant(value=type))
>>> ast.fix_missing_locations(e)
<_ast.Expression object at 0x7fc2c23981c0>
>>> compile(e, "<test>", "eval")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: got an invalid type in Constant: type
But if something is part of constant tuple and frozenset isn't constant, the error reporting is wrong
>>> e = ast.Expression(body=ast.Constant(value=(1,2,type)))
>>> compile(e, "<test>", "eval")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: got an invalid type in Constant: tuple
This should've been
TypeError: got an invalid type in Constant: type |
|
Date |
User |
Action |
Args |
2020-03-18 09:46:12 | BTaskaya | set | recipients:
+ BTaskaya |
2020-03-18 09:46:11 | BTaskaya | set | messageid: <1584524771.97.0.157412190348.issue40000@roundup.psfhosted.org> |
2020-03-18 09:46:11 | BTaskaya | link | issue40000 messages |
2020-03-18 09:46:11 | BTaskaya | create | |
|