mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Be more explicit about range policing
(rather than doing it in some roundabout crazy way)
This commit is contained in:
parent
880cb03191
commit
0dc4639cbf
1 changed files with 2 additions and 0 deletions
|
|
@ -239,6 +239,8 @@ class UnspacedList(list):
|
|||
# Normalize indexes like list[-1] etc, and save the result
|
||||
if idx < 0:
|
||||
idx = len(self) + idx
|
||||
if not 0 <= idx < len(self):
|
||||
raise IndexError("list index out of range")
|
||||
idx0 = idx
|
||||
# Count the number of spaces in the spaced list before idx in the unspaced one
|
||||
while idx != -1:
|
||||
|
|
|
|||
Loading…
Reference in a new issue