aboutsummaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorJesus Cea <jcea@jcea.es>2011-04-25 04:03:58 +0200
committerJesus Cea <jcea@jcea.es>2011-04-25 04:03:58 +0200
commitc1935d2abf4ce18031ecbdba0475574260d8256c (patch)
tree1a7ff7934b0e8c64d0684bedbb5ff9b591628dc5 /Parser
parentpybench prep_times calculation error (closes #11895) (diff)
downloadcpython-c1935d2abf4ce18031ecbdba0475574260d8256c.tar.gz
cpython-c1935d2abf4ce18031ecbdba0475574260d8256c.tar.bz2
cpython-c1935d2abf4ce18031ecbdba0475574260d8256c.zip
Revert bb62908896fe, but keep the test
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index f7ca5982328..f4d7e3fc683 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -585,19 +585,12 @@ decoding_fgets(char *s, int size, struct tok_state *tok)
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