~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_patiencediff_py.py

  • Committer: Martin Pool
  • Date: 2008-04-24 07:22:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3415.
  • Revision ID: mbp@sourcefrog.net-20080424072253-opmjij7xfy38w27f
Remove every assert statement from bzrlib!

Depending on the context they are:

 * turned into an explicit if/raise of either AssertionError 
   or something more specific -- particularly where they protect
   programming interfaces, complex invariants, or data file integrity
 * removed, if they're redundant with a later check, not protecting
   a meaningful invariant
 * turned into a selftest method on tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
    next_a = -1
198
198
    next_b = -1
199
199
    for a,b,match_len in answer:
200
 
        assert a >= next_a, 'Non increasing matches for a'
201
 
        assert b >= next_b, 'Not increasing matches for b'
 
200
        if a < next_a:
 
201
            raise ValueError('Non increasing matches for a')
 
202
        if b < next_b:
 
203
            raise ValueError('Not increasing matches for b')
202
204
        next_a = a + match_len
203
205
        next_b = b + match_len
204
206