gh-117535: Change unknown filename of warnings from sys to <sys> (#118018)

This commit is contained in:
Tian Gao 2024-04-18 20:50:09 -07:00 committed by GitHub
parent 398abdd6fa
commit a09e472992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 6 deletions

View file

@ -894,8 +894,8 @@ setup_context(Py_ssize_t stack_level,
if (f == NULL) {
globals = interp->sysdict;
*filename = PyUnicode_FromString("sys");
*lineno = 1;
*filename = PyUnicode_FromString("<sys>");
*lineno = 0;
}
else {
globals = f->f_frame->f_globals;