Skip to content

Commit 1497866

Browse files
[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 2677dd0) Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent 7bb999d commit 1497866

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)