summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-23 12:12:02 +0000
committerChristian Heimes <christian@cheimes.de>2007-11-23 12:12:02 +0000
commit02c9ab568d1458e4c1ea2ca700c5d25bb31e8002 (patch)
treeedf8d08a2f2aea45d78c32c95ece0c825fcfa32d /Python/ast.c
parent729ab15370c8e7781f4781428364d203eb9f6416 (diff)
downloadcpython-git-02c9ab568d1458e4c1ea2ca700c5d25bb31e8002.tar.gz
Fixed problems in the last commit. Filenames and line numbers weren't reported correctly.
Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 5555cf7ddf..9354b59cb0 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1336,10 +1336,14 @@ ast_for_atom(struct compiling *c, const node *n)
return Dict(keys, values, LINENO(n), n->n_col_offset, c->c_arena);
}
case BACKQUOTE: { /* repr */
- if (Py_Py3kWarningFlag &&
- PyErr_Warn(PyExc_DeprecationWarning,
- "backquote not supported in 3.x") < 0)
- return NULL;
+ if (Py_Py3kWarningFlag) {
+ if (PyErr_WarnExplicit(PyExc_DeprecationWarning,
+ "backquote not supported in 3.x",
+ "<unknown>", LINENO(n),
+ NULL, NULL)) {
+ ; //return NULL;
+ }
+ }
expr_ty expression = ast_for_testlist(c, CHILD(n, 1));
if (!expression)
return NULL;