summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFalk <falk-h@users.noreply.github.com>2022-06-19 03:37:12 +0200
committerGitHub <noreply@github.com>2022-06-19 04:37:12 +0300
commit41b537d9195ee8e4ab897951ba6563b367c28b7d (patch)
tree84e7d6c87c9c7ddf2ff173dcfd7330e0fff87c1f
parentbedf3c82a55b4b67eed93f686cb17e82f7ab19cd (diff)
downloadredis-py-41b537d9195ee8e4ab897951ba6563b367c28b7d.tar.gz
Uppercase commands in CommandsParser.get_keys (#2236)
-rw-r--r--CHANGES1
-rw-r--r--redis/asyncio/parser.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index b7e238e..2678218 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,5 @@
+ * Compare commands case-insensitively in the asyncio command parser
* Allow negative `retries` for `Retry` class to retry forever
* Add `items` parameter to `hset` signature
* Create codeql-analysis.yml (#1988). Thanks @chayim
diff --git a/redis/asyncio/parser.py b/redis/asyncio/parser.py
index 9518c3f..5faf8f8 100644
--- a/redis/asyncio/parser.py
+++ b/redis/asyncio/parser.py
@@ -55,14 +55,14 @@ class CommandsParser:
# try to split the command name and to take only the main command
# e.g. 'memory' for 'memory usage'
args = args[0].split() + list(args[1:])
- cmd_name = args[0]
+ cmd_name = args[0].upper()
if cmd_name not in self.commands:
# We'll try to reinitialize the commands cache, if the engine
# version has changed, the commands may not be current
await self.initialize()
if cmd_name not in self.commands:
raise RedisError(
- f"{cmd_name.upper()} command doesn't exist in Redis commands"
+ f"{cmd_name} command doesn't exist in Redis commands"
)
command = self.commands[cmd_name]