mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-103668: Run pyugrade on idlelib (#103671)
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
7255bbd4a1
commit
bd2dca035a
17 changed files with 50 additions and 50 deletions
|
@ -52,13 +52,13 @@ def idle_formatwarning(message, category, filename, lineno, line=None):
|
|||
"""Format warnings the IDLE way."""
|
||||
|
||||
s = "\nWarning (from warnings module):\n"
|
||||
s += ' File \"%s\", line %s\n' % (filename, lineno)
|
||||
s += f' File \"{filename}\", line {lineno}\n'
|
||||
if line is None:
|
||||
line = linecache.getline(filename, lineno)
|
||||
line = line.strip()
|
||||
if line:
|
||||
s += " %s\n" % line
|
||||
s += "%s: %s\n" % (category.__name__, message)
|
||||
s += f"{category.__name__}: {message}\n"
|
||||
return s
|
||||
|
||||
def idle_showwarning_subproc(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue