File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,7 @@ def write_record(self, record):
573573
574574 def write_records (self , records ):
575575 self ._ensure_validity ()
576+ records = list (records )
576577 write_record = self ._write_record
577578 for record in records :
578579 write_record (record )
@@ -593,9 +594,7 @@ def _write_record(self, record):
593594 fieldnames = self ._fieldnames
594595
595596 if fieldnames is None :
596- self ._fieldnames = fieldnames = list (record .keys ())
597- self ._fieldnames .extend (self .custom_fields )
598- fieldnames .extend (self .custom_fields )
597+ self ._fieldnames = fieldnames = {* list (record .keys ())} | self .custom_fields
599598 value_list = imap (lambda fn : (str (fn ), str ('__mv_' ) + str (fn )), fieldnames )
600599 self ._writerow (list (chain .from_iterable (value_list )))
601600
You can’t perform that action at this time.
0 commit comments