self.check_suite("import sys as system, math")
self.check_suite("import sys, math as my_math")
+ def test_assert(self):
+ self.check_suite("assert alo < ahi and blo < bhi\n")
+
#
# Second, we take *invalid* trees and make sure we get ParserError
# rejections for them.
(0, ''))
self.check_bad_tree(tree, "a $= b")
+ def test_malformed_global(self):
+ #doesn't have global keyword in ast
+ tree = (257,
+ (264,
+ (265,
+ (266,
+ (282, (1, 'foo'))), (4, ''))),
+ (4, ''),
+ (0, ''))
+ self.check_bad_tree(tree, "malformed global ast")
def test_main():
loader = unittest.TestLoader()
Release date: XX-XXX-2003
============================
+- SF bug #678518: fix some bugs in the parser module.
+
- Bastion.py and rexec.py are disabled. These modules are not safe in
Python 2.2. or 2.3.
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));
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())