Message218383
With the development version (Python 3.5), I reproduce the crash when Python is compiled in debug mode:
$ ./python astlinenotest.py
python: Python/compile.c:3975: assemble_lnotab: Assertion `d_lineno >= 0' failed.
Abandon (core dumped)
The problem is that astlinenotest.py creates an AST node without lineno information, which makes an assertion to fail in the compiler.
In my astoptimizer project, I use this function to not have to worry of the lineno:
def copy_lineno(node, new_node):
ast.fix_missing_locations(new_node)
ast.copy_location(new_node, node)
return new_node |
|
Date |
User |
Action |
Args |
2014-05-12 23:45:25 | vstinner | set | recipients:
+ vstinner, terry.reedy, ztane |
2014-05-12 23:45:25 | vstinner | set | messageid: <1399938325.33.0.640799848381.issue21385@psf.upfronthosting.co.za> |
2014-05-12 23:45:25 | vstinner | link | issue21385 messages |
2014-05-12 23:45:24 | vstinner | create | |
|