Project

General

Profile

« Previous | Next » 

Revision 2672

streams.py: LineCountInputStream: Fixed bug where EOF was incorrectly considered a line, causing the final line count (used by ProgressInputStream) to be off by one

View differences:

streams.py
99 99
    '''
100 100
    def __init__(self, stream):
101 101
        self.line_num = 1
102
        def trace(str_): self.line_num += 1
102
        def trace(str_):
103
            if str_ != '': self.line_num += 1 # EOF is not a line
103 104
        TracedStream.__init__(self, trace, stream)
104 105
    
105 106
    def write(self, str_): raise InputStreamsOnlyException()

Also available in: Unified diff