Skip to content

Commit cfcc620

Browse files
committed
Allow empty watches in Redis.transaction()
1 parent d7678e0 commit cfcc620

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

redis/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ def transaction(self, func, *watches, **kwargs):
240240
with self.pipeline(True, shard_hint) as pipe:
241241
while 1:
242242
try:
243-
pipe.watch(*watches)
243+
if watches:
244+
pipe.watch(*watches)
244245
func(pipe)
245246
return pipe.execute()
246247
except WatchError:

0 commit comments

Comments
 (0)