Remove CSVLogger.encode_row_s()

Introduced during Python 3 conversion to maintaint Python 2 support:

55a7973b ("Python3: fix csvlog", 2016-12-04)
This commit is contained in:
Chris Mayo 2020-05-16 17:02:00 +01:00
parent ed13a926d3
commit 2c2e7e55ac

View file

@ -119,15 +119,9 @@ class CSVLogger (_Logger):
self.writerow(map(strformat.unicode_safe, row))
self.flush()
def encode_row_s(self, row_s):
if isinstance(row_s, str):
return row_s # Python 3
else:
return row_s.encode("utf-8", self.codec_errors) # Python 2
def writerow (self, row):
"""Write one row in CSV format."""
self.writer.writerow([self.encode_row_s(s) for s in row])
self.writer.writerow(row)
# Fetch UTF-8 output from the queue ...
data = self.queue.getvalue()
try: