]> granicus.if.org Git - python/commitdiff
Add 1 to lineno in deprecation warning. Fixes #590888.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 5 Aug 2002 01:49:16 +0000 (01:49 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 5 Aug 2002 01:49:16 +0000 (01:49 +0000)
Parser/tokenizer.c

index 53c883f5e4c4775795303fd2664cea1883ea1304..18884fe733667b7f16492a7475f77170dfd4e909 100644 (file)
@@ -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;
        }