[3.14] Use f-strings in csv docs example (GH-135245) (#135285)

Use f-strings in csv docs example (GH-135245)
(cherry picked from commit 2677dd017a033eaaad3b8e1e0eb5664a44e7e231)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-06-09 08:37:15 +02:00 committed by GitHub
parent 7bb999d431
commit 1497866198
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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