[Python-checkins] cpython: Revert bb62908896fe, but keep the test
jesus.cea
python-checkins at python.org
Mon Apr 25 04:04:03 CEST 2011
http://hg.python.org/cpython/rev/4658762a77cf
changeset: 69550:4658762a77cf
user: Jesus Cea <jcea at jcea.es>
date: Mon Apr 25 04:03:58 2011 +0200
summary:
Revert bb62908896fe, but keep the test
files:
Parser/tokenizer.c | 19 ++++++-------------
1 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -585,19 +585,12 @@
if (badchar) {
/* Need to add 1 to the line number, since this line
has not been counted, yet. */
- if (tok->filename != NULL)
- filename = PyUnicode_DecodeFSDefault(tok->filename);
- else
- filename = PyUnicode_FromString("<file>");
- if (filename != NULL) {
- PyErr_Format(PyExc_SyntaxError,
- "Non-UTF-8 code starting with '\\x%.2x' "
- "in file %U on line %i, "
- "but no encoding declared; "
- "see http://python.org/dev/peps/pep-0263/ for details",
- badchar, filename, tok->lineno + 1);
- Py_DECREF(filename);
- }
+ PyErr_Format(PyExc_SyntaxError,
+ "Non-UTF-8 code starting with '\\x%.2x' "
+ "in file %U on line %i, "
+ "but no encoding declared; "
+ "see http://python.org/dev/peps/pep-0263/ for details",
+ badchar, tok->filename, tok->lineno + 1);
return error_ret(tok);
}
#endif
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list