summaryrefslogtreecommitdiffstats
path: root/Lib/csv.py
diff options
context:
space:
mode:
authorRĂ©mi Lapeyre <remi.lapeyre@henki.fr>2019-05-10 01:50:11 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-05-10 01:50:11 (GMT)
commitfce5ff1e18b522cf52379934a6560583d840e7f9 (patch)
tree89d1c624372e8840a1c843e4e78f16088e32df1a /Lib/csv.py
parentd237b3f0f61990c972b84c45eb4fe137db51a6a7 (diff)
downloadcpython-fce5ff1e18b522cf52379934a6560583d840e7f9.zip
cpython-fce5ff1e18b522cf52379934a6560583d840e7f9.tar.gz
cpython-fce5ff1e18b522cf52379934a6560583d840e7f9.tar.bz2
bpo-27497: Add return value to csv.DictWriter.writeheader (GH-12306)
csv.DictWriter.writeheader() now returns the return value of the underlying csv.Writer.writerow() method. Patch contributed by Ashish Nitin Patil.
Diffstat (limited to 'Lib/csv.py')
-rw-r--r--Lib/csv.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/csv.py b/Lib/csv.py
index eeeedab..dc85077 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -140,7 +140,7 @@ class DictWriter:
def writeheader(self):
header = dict(zip(self.fieldnames, self.fieldnames))
- self.writerow(header)
+ return self.writerow(header)
def _dict_to_list(self, rowdict):
if self.extrasaction == "raise":