Skip to content

Commit d92405b

Browse files
committed
Merge pull request #229 from Suor/master
Allow empty watches in Redis.transaction()
2 parents d7678e0 + cfcc620 commit d92405b

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)