From: Ezio Melotti Date: Sun, 8 Jun 2025 22:28:37 +0000 (+0200) Subject: Use f-strings in csv docs example (#135245) X-Git-Tag: v3.15.0a1~1351 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2677dd017a033eaaad3b8e1e0eb5664a44e7e231;p=thirdparty%2FPython%2Fcpython.git Use f-strings in csv docs example (#135245) --- diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index 5297be17bd70..2e513bff651c 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -609,7 +609,7 @@ A slightly more advanced use of the reader --- catching and reporting errors:: for row in reader: print(row) except csv.Error as e: - sys.exit('file {}, line {}: {}'.format(filename, reader.line_num, e)) + sys.exit(f'file {filename}, line {reader.line_num}: {e}') And while the module doesn't directly support parsing strings, it can easily be done::