diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-10-03 20:27:13 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-10-03 20:27:13 (GMT) |
commit | bd27aef8a0f776cc72387be31e1e74ecbcbbdf54 (patch) | |
tree | 8a9d5e2c6806d487004caea2bf891fd0644f0ec4 /Python | |
parent | 8504d085b7e5ae7dd75ad83fef5e79669d297fc4 (diff) | |
download | cpython-bd27aef8a0f776cc72387be31e1e74ecbcbbdf54.zip cpython-bd27aef8a0f776cc72387be31e1e74ecbcbbdf54.tar.gz cpython-bd27aef8a0f776cc72387be31e1e74ecbcbbdf54.tar.bz2 |
Merged revisions 75223 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75223 | benjamin.peterson | 2009-10-03 15:23:24 -0500 (Sat, 03 Oct 2009) | 1 line
#7050 fix a SystemError when using tuple unpacking and augmented assignment
........
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index dfcc8e3..8a35a12 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -2115,6 +2115,19 @@ ast_for_expr_stmt(struct compiling *c, const node *n) return NULL; if(!set_context(c, expr1, Store, ch)) return NULL; + /* set_context checks that most expressions are not the left side. + Augmented assignments can only have a name, a subscript, or an + attribute on the left, though, so we have to explicitly check for + those. */ + switch (expr1->kind) { + case Name_kind: + case Attribute_kind: + case Subscript_kind: + break; + default: + ast_error(ch, "illegal expression for augmented assignment"); + return NULL; + } ch = CHILD(n, 2); if (TYPE(ch) == testlist) |