diff options
| author | Raymond Hettinger <python@rcn.com> | 2004-09-29 23:54:08 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2004-09-29 23:54:08 +0000 |
| commit | 20d6cdd4429d1e30f443c8ca9e54dffbd788b4dc (patch) | |
| tree | fcefbaeb9cecfb133aa8e3aa9e636852a17bae6f /Python/compile.c | |
| parent | 98115f9d607f08353a16a77496ab4d0ed354e630 (diff) | |
| download | cpython-20d6cdd4429d1e30f443c8ca9e54dffbd788b4dc.tar.gz | |
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.
Diffstat (limited to 'Python/compile.c')
| -rw-r--r-- | Python/compile.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
