fix: py3 AttributeError decode

str has no attribute decode in python3, use cstr to convert to str
This commit is contained in:
gregor-horvath 2020-10-08 21:12:09 +02:00 committed by GitHub
parent 0bf1c61356
commit 603a60e0a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,7 +99,7 @@ class RedisWrapper(redis.Redis):
except redis.exceptions.ConnectionError:
regex = re.compile(cstr(key).replace("|", "\|").replace("*", "[\w]*"))
return [k for k in list(frappe.local.cache) if regex.match(k.decode())]
return [k for k in list(frappe.local.cache) if regex.match(cstr(k))]
def delete_keys(self, key):
"""Delete keys with wildcard `*`."""