Commit 725bb233 authored by Martin v. Löwis's avatar Martin v. Löwis

Add 1 to lineno in deprecation warning. Fixes #590888.

parent 4c561b36
......@@ -432,8 +432,10 @@ decoding_fgets(char *s, int size, struct tok_state *tok)
char buf[200];
sprintf(buf, "Non-ASCII character '\\x%.2x', "
"but no declared encoding", badchar);
/* Need to add 1 to the line number, since this line
has not been counted, yet. */
PyErr_WarnExplicit(PyExc_DeprecationWarning,
buf, tok->filename, tok->lineno,
buf, tok->filename, tok->lineno + 1,
NULL, NULL);
tok->issued_encoding_warning = 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment