Skip to content

Commit b2db73d

Browse files
committed
Change py impl
1 parent 3958411 commit b2db73d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/bisect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def bisect_right(a, x, lo=0, hi=None, *, key=None):
3333

3434
if lo < 0:
3535
raise ValueError('lo must be non-negative')
36-
if hi is None:
36+
if hi is None or hi < 0:
3737
hi = len(a)
3838
# Note, the comparison uses "<" to match the
3939
# __lt__() logic in list.sort() and in heapq.
@@ -86,7 +86,7 @@ def bisect_left(a, x, lo=0, hi=None, *, key=None):
8686

8787
if lo < 0:
8888
raise ValueError('lo must be non-negative')
89-
if hi is None:
89+
if hi is None or hi < 0:
9090
hi = len(a)
9191
# Note, the comparison uses "<" to match the
9292
# __lt__() logic in list.sort() and in heapq.

0 commit comments

Comments
 (0)