Comment 5 for bug 567250

Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 567250] Re: IndexError on startup after external changes to @shadow files

On Wed, Apr 21, 2010 at 1:31 AM, Antti Kaihola
<email address hidden> wrote:
> I had another file do the same and noticed the external changes had
> appended a space without a newline to the file.

Let's try a simple-minded guard. Change sourcereader.get to:

def get (self):

    trace = False and not g.unitTesting

    if self.i < len(self.lines):
        result = self.lines[self.i]
        self.i+=1
    else:
        result = ''

    if trace: g.trace(repr(result))
    return result

Does this work for you?

Edward