From e031660c9b4dd51495ca6ddfca046ea48c89f5ae Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sun, 8 Jun 2025 07:03:36 +0200 Subject: [PATCH] Use f-strings in csv docs example --- Doc/library/csv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index 5297be17bd708e..2e513bff651cd2 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::