From: Jeremy Hylton Date: Wed, 21 Mar 2001 19:01:33 +0000 (+0000) Subject: Update PyNode_CompileSymtable() to understand future statements X-Git-Tag: v2.1b2~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ded4bd776f25d892e5dbdc642f3b92aacd43dae1;p=thirdparty%2FPython%2Fcpython.git Update PyNode_CompileSymtable() to understand future statements --- diff --git a/Python/compile.c b/Python/compile.c index ed50f7ef41b5..cd936a3aff6c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3780,22 +3780,28 @@ struct symtable * 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 *