summaryrefslogtreecommitdiff
path: root/redis/commands/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r--redis/commands/core.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py
index e3a758d..3278c57 100644
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -2265,6 +2265,8 @@ class BasicKeyCommands(CommandsProtocol):
pieces.append(int(ex.total_seconds()))
elif isinstance(ex, int):
pieces.append(ex)
+ elif isinstance(ex, str) and ex.isdigit():
+ pieces.append(int(ex))
else:
raise DataError("ex must be datetime.timedelta or int")
if px is not None: