Revert bb62908896fe, but keep the test
This commit is contained in:
parent
4f711726be
commit
c1935d2abf
|
@ -585,19 +585,12 @@ decoding_fgets(char *s, int size, struct tok_state *tok)
|
||||||
if (badchar) {
|
if (badchar) {
|
||||||
/* Need to add 1 to the line number, since this line
|
/* Need to add 1 to the line number, since this line
|
||||||
has not been counted, yet. */
|
has not been counted, yet. */
|
||||||
if (tok->filename != NULL)
|
PyErr_Format(PyExc_SyntaxError,
|
||||||
filename = PyUnicode_DecodeFSDefault(tok->filename);
|
"Non-UTF-8 code starting with '\\x%.2x' "
|
||||||
else
|
"in file %U on line %i, "
|
||||||
filename = PyUnicode_FromString("<file>");
|
"but no encoding declared; "
|
||||||
if (filename != NULL) {
|
"see http://python.org/dev/peps/pep-0263/ for details",
|
||||||
PyErr_Format(PyExc_SyntaxError,
|
badchar, tok->filename, tok->lineno + 1);
|
||||||
"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);
|
|
||||||
}
|
|
||||||
return error_ret(tok);
|
return error_ret(tok);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue