Skip to content

Commit 8c28241

Browse files
[3.13] Use f-strings in csv docs example (GH-135245) (#135286)
Use f-strings in csv docs example (GH-135245) (cherry picked from commit 2677dd0) Co-authored-by: Ezio Melotti <[email protected]>
1 parent f0d48b2 commit 8c28241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/csv.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ A slightly more advanced use of the reader --- catching and reporting errors::
609609
for row in reader:
610610
print(row)
611611
except csv.Error as e:
612-
sys.exit('file {}, line {}: {}'.format(filename, reader.line_num, e))
612+
sys.exit(f'file {filename}, line {reader.line_num}: {e}')
613613

614614
And while the module doesn't directly support parsing strings, it can easily be
615615
done::

0 commit comments

Comments
 (0)