Mercurial > cpython-lru_cache-weakref
diff Modules/parsermodule.c @ 27778:1dc6366543d4 2.2
Partial backport for changes to fix SF bug #678518 (assert & global).
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Mon, 10 Feb 2003 01:57:51 +0000 |
| parents | 1d8c86234d9c |
| children | b4487a3b5f1a |
line wrap: on
line diff
--- a/Modules/parsermodule.c Fri Feb 07 20:51:20 2003 +0000 +++ b/Modules/parsermodule.c Mon Feb 10 01:57:51 2003 +0000 @@ -1692,6 +1692,9 @@ int res = (validate_ntype(tree, global_stmt) && is_even(nch) && (nch >= 2)); + if (!res && !PyErr_Occurred()) + err_string("illegal global statement"); + if (res) res = (validate_name(CHILD(tree, 0), "global") && validate_ntype(CHILD(tree, 1), NAME)); @@ -1739,8 +1742,7 @@ int nch = NCH(tree); int res = (validate_ntype(tree, assert_stmt) && ((nch == 2) || (nch == 4)) - && (validate_name(CHILD(tree, 0), "__assert__") || - validate_name(CHILD(tree, 0), "assert")) + && (validate_name(CHILD(tree, 0), "assert")) && validate_test(CHILD(tree, 1))); if (!res && !PyErr_Occurred())
