diff options
author | Falk <falk-h@users.noreply.github.com> | 2022-06-19 03:37:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 04:37:12 +0300 |
commit | 41b537d9195ee8e4ab897951ba6563b367c28b7d (patch) | |
tree | 84e7d6c87c9c7ddf2ff173dcfd7330e0fff87c1f | |
parent | bedf3c82a55b4b67eed93f686cb17e82f7ab19cd (diff) | |
download | redis-py-41b537d9195ee8e4ab897951ba6563b367c28b7d.tar.gz |
Uppercase commands in CommandsParser.get_keys (#2236)
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | redis/asyncio/parser.py | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -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] |