From 39ce6852f56021ac9f80359f3a1e387593cfbbbb Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Mon, 10 Jan 2022 06:19:40 -0500 Subject: Set keys var otherwise variable not created (#1853) --- redis/commands/parser.py | 3 +-- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.1