Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89ce454

Browse files
committed
Make sure that -t and -tt also work on strings passed to compile().
1 parent b55f9ff commit 89ce454

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Parser/parsetok.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ PyParser_ParseString(s, g, start, err_ret)
6868
return NULL;
6969
}
7070

71+
if (Py_TabcheckFlag || Py_VerboseFlag) {
72+
tok->filename = "<string>";
73+
tok->altwarning = (tok->filename != NULL);
74+
if (Py_TabcheckFlag >= 2)
75+
tok->alterror++;
76+
}
77+
7178
return parsetok(tok, g, start, err_ret);
7279
}
7380

0 commit comments

Comments
 (0)