Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 21179:485422900ef0 legacy-trunk
SF bug #488687 reported by Neal Norwitz
The error for assignment to __debug__ used ste->ste_opt_lineno instead
of n->n_lineno. The latter was at best incorrect; often the slot was
uninitialized. Two fixes here: Use the correct lineno for the error.
Initialize ste_opt_lineno in PySymtable_New(); while there are no
current cases where it is referenced unless it has already been
assigned to, there is no harm in initializing it.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Tue, 04 Dec 2001 02:41:46 +0000 |
| parents | ea5b0f0b716f |
| children | de125792bfaa |
line wrap: on
line diff
--- a/Python/compile.c Tue Dec 04 01:11:32 2001 +0000 +++ b/Python/compile.c Tue Dec 04 02:41:46 2001 +0000 @@ -5464,7 +5464,7 @@ PyErr_SetString(PyExc_SyntaxError, ASSIGN_DEBUG); PyErr_SyntaxLocation(st->st_filename, - st->st_cur->ste_opt_lineno); + n->n_lineno); st->st_errors++; } symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag);
