[Python-checkins] r50489 - in python/trunk: Lib/test/test_compile.py Misc/NEWS Python/ast.c

Georg Brandl g.brandl at gmx.net
Sat Jul 8 14:17:34 CEST 2006


neal.norwitz wrote:
> Author: neal.norwitz
> Date: Sat Jul  8 07:31:37 2006
> New Revision: 50489

> Modified: python/trunk/Python/ast.c
> ==============================================================================
> --- python/trunk/Python/ast.c	(original)
> +++ python/trunk/Python/ast.c	Sat Jul  8 07:31:37 2006
> @@ -2142,7 +2142,14 @@
>   loop:
>      switch (TYPE(n)) {
>          case import_as_name:
> -            str = (NCH(n) == 3) ? NEW_IDENTIFIER(CHILD(n, 2)) : NULL;
> +            str = NULL;
> +            if (NCH(n) == 3) {
> +                if (strcmp(STR(CHILD(n, 1)), "as") != 0) {
> +                    ast_error(n, "must use 'as' in import");

Note that 2.4 had just "invalid syntax" here (since "as" is supposed to be
a quasi-keyword in this place, that makes sense).

Georg



More information about the Python-checkins mailing list