summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com>2022-01-10 06:19:40 -0500
committerGitHub <noreply@github.com>2022-01-10 13:19:40 +0200
commit39ce6852f56021ac9f80359f3a1e387593cfbbbb (patch)
treeb7dc6e7eeb78aca8b0e681c29883c56299ab9ce0
parent80f1d2f3f056f5e4e81796158dd29b0799f54dc7 (diff)
downloadredis-py-39ce6852f56021ac9f80359f3a1e387593cfbbbb.tar.gz
Set keys var otherwise variable not created (#1853)
-rw-r--r--redis/commands/parser.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/redis/commands/parser.py b/redis/commands/parser.py
index dadf3c6..4cce800 100644
--- a/redis/commands/parser.py
+++ b/redis/commands/parser.py
@@ -103,6 +103,7 @@ class CommandsParser:
return None
args = [str_if_bytes(arg) for arg in args]
command = args[0].upper()
+ keys = None
if command == "PUBSUB":
# the second argument is a part of the command name, e.g.
# ['PUBSUB', 'NUMSUB', 'foo'].
@@ -117,6 +118,4 @@ class CommandsParser:
# format example:
# PUBLISH channel message
keys = [args[1]]
- else:
- keys = None
return keys