From 2e4cc7e0d84747826d3d2546d1bccd9c40a455c2 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Mon, 17 Sep 2001 19:33:48 +0000 Subject: Last set of change to get regression tests to pass Remove the only test in the syntax module. It ends up that the transformer must handle this error case. In the transformer, check for a list compression in com_assign_list() by looking for a list_for node where a comma is expected. In pycodegen.compile() re-raise the SyntaxError rather than catching it and exiting --- Lib/compiler/syntax.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Lib/compiler/syntax.py') diff --git a/Lib/compiler/syntax.py b/Lib/compiler/syntax.py index 14613ef787..88c1453a1f 100644 --- a/Lib/compiler/syntax.py +++ b/Lib/compiler/syntax.py @@ -39,7 +39,8 @@ class SyntaxErrorChecker: def visitAssign(self, node): # the transformer module handles many of these for target in node.nodes: - if isinstance(target, ast.AssList): - if target.lineno is None: - target.lineno = node.lineno - self.error(target, "can't assign to list comprehension") + pass +## if isinstance(target, ast.AssList): +## if target.lineno is None: +## target.lineno = node.lineno +## self.error(target, "can't assign to list comprehension") -- cgit v1.2.1