Skip to content

Commit be26730

Browse files
authored
ensuring we adhere to exlusive options for getex (#1531)
1 parent fc69bd6 commit be26730

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

redis/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,11 @@ def getex(self, name,
17371737
``persist`` remove the time to live associated with ``name``.
17381738
"""
17391739

1740+
opset = set([ex, px, exat, pxat])
1741+
if len(opset) > 2 or len(opset) > 1 and persist:
1742+
raise DataError("``ex``, ``px``, ``exat``, ``pxat``",
1743+
"and ``persist`` are mutually exclusive.")
1744+
17401745
pieces = []
17411746
# similar to set command
17421747
if ex is not None:

0 commit comments

Comments
 (0)