Skip to content

Commit 03880a9

Browse files
committed
Fix an RPOP corner case that only worked for LPOP
Popping 0 elements from a list in Redis 6.2.6 is not an error even if the key is the wrong type. This was correctly implemented for LPOP, but for RPOP it wasn't done correctly (picked up by hypothesis).
1 parent dabc409 commit 03880a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fakeredis/_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ def ltrim(self, key, start, stop):
18531853
key.update(new_value)
18541854
return OK
18551855

1856-
@command((Key(list),), (Int(),))
1856+
@command((Key(),), (Int(),))
18571857
def rpop(self, key, *args):
18581858
return self._list_pop(lambda count: slice(None, -count - 1, -1), key, *args)
18591859

0 commit comments

Comments
 (0)