]> granicus.if.org Git - python/commitdiff
Make sure that -t and -tt also work on strings passed to compile().
authorGuido van Rossum <guido@python.org>
Mon, 21 Dec 1998 18:32:40 +0000 (18:32 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 21 Dec 1998 18:32:40 +0000 (18:32 +0000)
Parser/parsetok.c

index 6453b6afe55a133510a7e6add04cd695b11f66e3..5b0d99050fcc709994e98d7e9b91bf0971d76790 100644 (file)
@@ -68,6 +68,13 @@ PyParser_ParseString(s, g, start, err_ret)
                return NULL;
        }
 
+       if (Py_TabcheckFlag || Py_VerboseFlag) {
+               tok->filename = "<string>";
+               tok->altwarning = (tok->filename != NULL);
+               if (Py_TabcheckFlag >= 2)
+                       tok->alterror++;
+       }
+
        return parsetok(tok, g, start, err_ret);
 }