Skip to content

Commit

Permalink
fix: Don't use the deprecated location for Hashable
Browse files Browse the repository at this point in the history
The Hashable object was moved in python 3.3 and support for the old
location is dropped in python 3.10 the new location is available in
python 3.8 so we can just update this and it should work with both
python 3.8 and 3.11

https://docs.python.org/3.8/library/collections.html
  • Loading branch information
feanil committed Apr 11, 2024
1 parent 3b0e407 commit c183995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openedx/core/lib/cache_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(self, func):
self.cache = {}

def __call__(self, *args):
if not isinstance(args, collections.Hashable):
if not isinstance(args, collections.abc.Hashable):
# uncacheable. a list, for instance.
# better to not cache than blow up.
return self.func(*args)
Expand Down

0 comments on commit c183995

Please sign in to comment.