Skip to content

Commit 3fb2c68

Browse files
authored
raise an exception if query TIMEOUT is a non negative integer
1 parent b59492b commit 3fb2c68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redis/commands/search/query.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ def _get_args_tags(self):
194194
args += self._ids
195195
if self._slop >= 0:
196196
args += ["SLOP", self._slop]
197-
if self._timeout is not None:
197+
if isinstance(self._timeout, int) and self._timeout >= 0:
198198
args += ["TIMEOUT", self._timeout]
199+
else:
200+
raise AttributeError("TIMEOUT requires a non negative integer.")
199201
if self._in_order:
200202
args.append("INORDER")
201203
if self._return_fields:

0 commit comments

Comments
 (0)