Mercurial > cpython-lru_cache-weakref
diff Python/ast.c @ 43983:e725166c8c81 legacy-trunk
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.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Fri, 23 Nov 2007 12:12:02 +0000 |
| parents | 5f6a8e2b9e9c |
| children | af360380aa16 |
line wrap: on
line diff
--- a/Python/ast.c Fri Nov 23 09:10:36 2007 +0000 +++ b/Python/ast.c Fri Nov 23 12:12:02 2007 +0000 @@ -1336,10 +1336,14 @@ 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;
