Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.5
Changeset: r89532:056335ce40d8
Date: 2017-01-12 23:03 +0100
http://bitbucket.org/pypy/pypy/changeset/056335ce40d8/
Log: hg backout a1c35f4c589a
The test was fixed in 511e7a4e706b
diff --git a/pypy/interpreter/astcompiler/astbuilder.py
b/pypy/interpreter/astcompiler/astbuilder.py
--- a/pypy/interpreter/astcompiler/astbuilder.py
+++ b/pypy/interpreter/astcompiler/astbuilder.py
@@ -126,7 +126,7 @@
try:
misc.check_forbidden_name(name)
except misc.ForbiddenNameAssignment as e:
- self.error("assignment to keyword", node)
+ self.error("cannot assign to %s" % (e.name,), node)
def new_identifier(self, name):
return misc.new_identifier(self.space, name)
@@ -138,7 +138,7 @@
except ast.UnacceptableExpressionContext as e:
self.error_ast(e.msg, e.node)
except misc.ForbiddenNameAssignment as e:
- self.error_ast("assignment to keyword", e.node)
+ self.error_ast("cannot assign to %s" % (e.name,), e.node)
def handle_del_stmt(self, del_node):
targets = self.handle_exprlist(del_node.get_child(1), ast.Del)
diff --git a/pypy/interpreter/astcompiler/asthelpers.py
b/pypy/interpreter/astcompiler/asthelpers.py
--- a/pypy/interpreter/astcompiler/asthelpers.py
+++ b/pypy/interpreter/astcompiler/asthelpers.py
@@ -182,5 +182,5 @@
class __extend__(ast.NameConstant):
- _description = "keyword"
+ _description = "name constant"
constant = True
diff --git a/pypy/interpreter/astcompiler/test/test_astbuilder.py
b/pypy/interpreter/astcompiler/test/test_astbuilder.py
--- a/pypy/interpreter/astcompiler/test/test_astbuilder.py
+++ b/pypy/interpreter/astcompiler/test/test_astbuilder.py
@@ -812,7 +812,7 @@
for template in invalid:
input = template % (name,)
exc = py.test.raises(SyntaxError, self.get_ast, input).value
- assert exc.msg == "assignment to keyword"
+ assert exc.msg == "cannot assign to %s" % (name,)
def test_lambda(self):
lam = self.get_first_expr("lambda x: expr")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit