gh-103668: Run pyugrade on idlelib (#103671)

---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Nikita Sobolev 2023-04-24 02:25:08 +03:00 committed by GitHub
parent 7255bbd4a1
commit bd2dca035a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 50 additions and 50 deletions

View file

@ -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(