From 5cad6d1938434b8b9f26d005f071e2bd7d0f9a90 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Tue, 4 Jan 2022 10:34:20 -0500 Subject: [PATCH] Set keys var otherwise variable not created --- 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 dadf3c6bf8..4cce800ec3 100644 --- a/redis/commands/parser.py +++ b/redis/commands/parser.py @@ -103,6 +103,7 @@ def _get_pubsub_keys(self, *args): 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 @@ def _get_pubsub_keys(self, *args): # format example: # PUBLISH channel message keys = [args[1]] - else: - keys = None return keys