Use f-strings in csv docs example (#135245)

This commit is contained in:
Ezio Melotti 2025-06-09 00:28:37 +02:00 committed by GitHub
parent 8d17a412da
commit 2677dd017a
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::