From: Raymond Hettinger Date: Wed, 29 Sep 2004 23:54:08 +0000 (+0000) Subject: Improve error message for augmented assignments to genexps or listcomps. X-Git-Tag: v2.4b1~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fec0c466ad17cc0dfa115ce3ba17a6011e3391d6;p=python Improve error message for augmented assignments to genexps or listcomps. Rather than introduce new logic, took the approach of making the message itself more general. --- diff --git a/Python/compile.c b/Python/compile.c index 24ca440c3d..dc636c0ea7 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3274,7 +3274,7 @@ com_assign(struct compiling *c, node *n, int assigning, node *augn) } if (assigning > OP_APPLY) { com_error(c, PyExc_SyntaxError, - "augmented assign to tuple literal not possible"); + "augmented assign to tuple literal or generator expression not possible"); return; } break; @@ -3287,7 +3287,7 @@ com_assign(struct compiling *c, node *n, int assigning, node *augn) } if (assigning > OP_APPLY) { com_error(c, PyExc_SyntaxError, - "augmented assign to list literal not possible"); + "augmented assign to list literal or comprehension not possible"); return; } if (NCH(n) > 1