summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-05-31 14:08:29 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-05-31 14:08:29 (GMT)
commit05ab2e693cf5bed23e14058cf9eb458441769122 (patch)
treeee0a3897beb1147586237572e01d073b24ea8924 /Python
parent5352d8c0c6ae6cce7af2fef7a3fb9ee26c6aad9b (diff)
downloadcpython-05ab2e693cf5bed23e14058cf9eb458441769122.zip
cpython-05ab2e693cf5bed23e14058cf9eb458441769122.tar.gz
cpython-05ab2e693cf5bed23e14058cf9eb458441769122.tar.bz2
Fix SF bug [ 561825 ] Confusing error for "del f()"
In the error message, say del for del and assign for everything else.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index cdb72ac..4bbe44f 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2417,8 +2417,12 @@ com_assign_trailer(struct compiling *c, node *n, int assigning, node *augn)
REQ(n, trailer);
switch (TYPE(CHILD(n, 0))) {
case LPAR: /* '(' [exprlist] ')' */
- com_error(c, PyExc_SyntaxError,
- "can't assign to function call");
+ if (assigning == OP_DELETE)
+ com_error(c, PyExc_SyntaxError,
+ "can't delete function call");
+ else
+ com_error(c, PyExc_SyntaxError,
+ "can't assign to function call");
break;
case DOT: /* '.' NAME */
if (assigning > OP_APPLY)