Skip to content

Commit 41b537d

Browse files
authored
Uppercase commands in CommandsParser.get_keys (#2236)
1 parent bedf3c8 commit 41b537d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
* Compare commands case-insensitively in the asyncio command parser
23
* Allow negative `retries` for `Retry` class to retry forever
34
* Add `items` parameter to `hset` signature
45
* Create codeql-analysis.yml (#1988). Thanks @chayim

redis/asyncio/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ async def get_keys(self, *args: Any) -> Optional[Tuple[str, ...]]:
5555
# try to split the command name and to take only the main command
5656
# e.g. 'memory' for 'memory usage'
5757
args = args[0].split() + list(args[1:])
58-
cmd_name = args[0]
58+
cmd_name = args[0].upper()
5959
if cmd_name not in self.commands:
6060
# We'll try to reinitialize the commands cache, if the engine
6161
# version has changed, the commands may not be current
6262
await self.initialize()
6363
if cmd_name not in self.commands:
6464
raise RedisError(
65-
f"{cmd_name.upper()} command doesn't exist in Redis commands"
65+
f"{cmd_name} command doesn't exist in Redis commands"
6666
)
6767

6868
command = self.commands[cmd_name]

0 commit comments

Comments
 (0)