mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-117535: Change unknown filename of warnings from sys
to <sys>
(#118018)
This commit is contained in:
parent
398abdd6fa
commit
a09e472992
4 changed files with 7 additions and 6 deletions
|
@ -332,8 +332,8 @@ def warn(message, category=None, stacklevel=1, source=None,
|
|||
raise ValueError
|
||||
except ValueError:
|
||||
globals = sys.__dict__
|
||||
filename = "sys"
|
||||
lineno = 1
|
||||
filename = "<sys>"
|
||||
lineno = 0
|
||||
else:
|
||||
globals = frame.f_globals
|
||||
filename = frame.f_code.co_filename
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue