Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 17112:76eab2ebce58 legacy-trunk
Update PyNode_CompileSymtable() to understand future statements
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Wed, 21 Mar 2001 19:01:33 +0000 |
| parents | a488a63cb867 |
| children | a8301d4ed2b1 |
line wrap: on
line diff
--- a/Python/compile.c Wed Mar 21 18:40:58 2001 +0000 +++ b/Python/compile.c Wed Mar 21 19:01:33 2001 +0000 @@ -3780,22 +3780,28 @@ PyNode_CompileSymtable(node *n, char *filename) { struct symtable *st; - + PyFutureFeatures *ff; + + ff = PyNode_Future(n, filename); + if (ff == NULL) + return NULL; st = symtable_init(); if (st == NULL) return NULL; - assert(st->st_symbols != NULL); + st->st_future = ff; symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno); - if (st->st_errors > 0) { - PySymtable_Free(st); - return NULL; - } + if (st->st_errors > 0) + goto fail; symtable_node(st, n); - if (st->st_errors > 0) { - PySymtable_Free(st); - return NULL; - } + if (st->st_errors > 0) + goto fail; + return st; + fail: + PyMem_Free((void *)ff); + st->st_future = NULL; + PySymtable_Free(st); + return NULL; } static PyCodeObject *
