aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-05-24 10:25:17 +0200
committerGravatar GitHub <[email protected]>2020-05-24 10:25:17 +0200
commited12a2fa303b7faebeb773dac096bd2b0b8ec23d (patch)
tree6a0106b22542645400a1d8389534e6e54bd35ba8
parentuse __name__ for type list (diff)
len(prefix) instead of hardcoding 2
Co-authored-by: Mark <[email protected]>
-rw-r--r--bot/utils/redis_cache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py
index fadbca673..13e88e8e1 100644
--- a/bot/utils/redis_cache.py
+++ b/bot/utils/redis_cache.py
@@ -120,7 +120,7 @@ class RedisCache:
# Now we convert our unicode string back into the type it originally was.
for prefix, _type in TYPESTRING_PREFIXES:
if value.startswith(prefix):
- return _type(value[2:])
+ return _type(value[len(prefix):])
raise TypeError(f"RedisCache._to_typestring only supports the prefixes {self._valid_typestring_prefixes()}.")
def _dict_from_typestring(self, dictionary: Dict) -> Dict: