Skip to content
Commit 0e7cc520 authored by Kai Willadsen's avatar Kai Willadsen
Browse files

Fix some cases of iteration over BufferLines (closes bgo#638314)

__getitem__ should raise an IndexError if an item beyond the last index
is requested. Previously we did not do this, because we expect requests
beyond the last line; specifically requests for (last line + 1). This
patch changes our behaviour to correctly raise an IndexError if the
request is for anything past (last line + 1).

This fixes some cases of infinite iteration, as __iter__ wants to see
that IndexError.
parent 63e38570
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment