mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
UnspacedList._spaced_position: support the slice at the end fo the list
- Which is needed for .insert()ing at the end, for instance.
This commit is contained in:
@@ -279,6 +279,9 @@ class UnspacedList(list):
|
||||
# Normalize indexes like list[-1] etc, and save the result
|
||||
if idx < 0:
|
||||
idx = len(self) + idx
|
||||
if idx == len(self):
|
||||
# not an index, but the slice at the end of the list
|
||||
return len(self.spaced)
|
||||
if not 0 <= idx < len(self):
|
||||
raise IndexError("list index out of range")
|
||||
idx0 = idx
|
||||
|
||||
Reference in New Issue
Block a user