Project

General

Profile

« Previous | Next » 

Revision 5585

csvs.py: InputRewriter: Also support stream inputs which report EOF as '' instead of StopIteration

View differences:

lib/csvs.py
157 157
    
158 158
    def readline(self):
159 159
        try: row = self.reader.next()
160
        except StopIteration: return '' # EOF
160
        except StopIteration: row = '' # EOF
161
        if row == '': return row # EOF
162
        
161 163
        line_stream = StringIO.StringIO()
162 164
        csv.writer(line_stream, self.dialect).writerow(row)
163 165
        return line_stream.getvalue()

Also available in: Unified diff