From dc35cda2de9888f78218fd5207f516ceec0d4e82 Mon Sep 17 00:00:00 2001 From: Ned Deily Date: Wed, 17 Aug 2016 17:18:33 -0400 Subject: Issue #27594: Prevent assertion error when running test_ast with coverage enabled: ensure code object has a valid first line number. Patch suggested by Ivan Levkivskyi. --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/compile.c') diff --git a/Python/compile.c b/Python/compile.c index e46676c0b0..fb80f51fc0 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4963,7 +4963,7 @@ assemble(struct compiler *c, int addNone) /* Set firstlineno if it wasn't explicitly set. */ if (!c->u->u_firstlineno) { - if (entryblock && entryblock->b_instr) + if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno) c->u->u_firstlineno = entryblock->b_instr->i_lineno; else c->u->u_firstlineno = 1; -- cgit v1.2.1