diff --git a/openedx/core/lib/cache_utils.py b/openedx/core/lib/cache_utils.py index dd80ceb9ccd1..6805243c135f 100644 --- a/openedx/core/lib/cache_utils.py +++ b/openedx/core/lib/cache_utils.py @@ -3,7 +3,6 @@ """ -import collections import functools import itertools import pickle @@ -125,7 +124,9 @@ def __init__(self, func): self.cache = {} def __call__(self, *args): - if not isinstance(args, collections.abc.Hashable): + try: + hash(args) + except TypeError: # uncacheable. a list, for instance. # better to not cache than blow up. return self.func(*args)