~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weavefile.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-20 22:32:33 UTC
  • mto: This revision was merged to the branch mainline in revision 2025.
  • Revision ID: john@arbash-meinel.com-20060920223233-8ec5b9c560295b60
When a weave file is empty, we should get WeaveFormatError, not StopIteration

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
 
125
125
    lines = iter(f.readlines())
126
126
    
127
 
    l = lines.next()
 
127
    try:
 
128
        l = lines.next()
 
129
    except StopIteration:
 
130
        raise WeaveFormatError('invalid weave file: no header')
 
131
 
128
132
    if l != FORMAT_1:
129
133
        raise WeaveFormatError('invalid weave file header: %r' % l)
130
134