diff Python/compile.c @ 33627:0ae0bef10014 legacy-trunk

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.
author Raymond Hettinger <python@rcn.com>
date Wed, 29 Sep 2004 23:54:08 +0000
parents cd58a9b4ba66
children bf18caca0730
line wrap: on
line diff
--- a/Python/compile.c	Wed Sep 29 21:47:10 2004 +0000
+++ b/Python/compile.c	Wed Sep 29 23:54:08 2004 +0000
@@ -3274,7 +3274,7 @@
 				}
 				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 @@
 				}
 				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