@@ -967,11 +967,11 @@ def determine_slot(self, *args):
967967 # redis server to parse the keys. Besides, there is a bug in redis<7.0
968968 # where `self._get_command_keys()` fails anyway. So, we special case
969969 # EVAL/EVALSHA.
970- if command in ("EVAL" , "EVALSHA" ):
970+ if command . upper () in ("EVAL" , "EVALSHA" ):
971971 # command syntax: EVAL "script body" num_keys ...
972972 if len (args ) <= 2 :
973973 raise RedisClusterException (f"Invalid args in command: { args } " )
974- num_actual_keys = args [2 ]
974+ num_actual_keys = int ( args [2 ])
975975 eval_keys = args [3 : 3 + num_actual_keys ]
976976 # if there are 0 keys, that means the script can be run on any node
977977 # so we can just return a random slot
@@ -983,7 +983,7 @@ def determine_slot(self, *args):
983983 if keys is None or len (keys ) == 0 :
984984 # FCALL can call a function with 0 keys, that means the function
985985 # can be run on any node so we can just return a random slot
986- if command in ("FCALL" , "FCALL_RO" ):
986+ if command . upper () in ("FCALL" , "FCALL_RO" ):
987987 return random .randrange (0 , REDIS_CLUSTER_HASH_SLOTS )
988988 raise RedisClusterException (
989989 "No way to dispatch this command to Redis Cluster. "
0 commit comments