ubuntutools/lp: Python 3.10 compatibility

This commit is contained in:
Graham Inggs 2022-01-20 16:21:56 +02:00 committed by Mattia Rizzolo
parent 3a903ca628
commit 0dde3262d1
No known key found for this signature in database
GPG Key ID: 0816B9E18C762BAD

View File

@ -162,7 +162,7 @@ class BaseWrapper(object, metaclass=MetaWrapper):
Logger.debug("%s: %s" % (cls.__name__, data.self_link))
# add additional class specific caching (if available)
cache = getattr(cls, 'cache', None)
if isinstance(cache, collections.Callable):
if isinstance(cache, collections.abc.Callable):
cache(cached)
return cached
else:
@ -171,7 +171,7 @@ class BaseWrapper(object, metaclass=MetaWrapper):
else:
# not a LP API representation, let the specific class handle it
fetch = getattr(cls, 'fetch', None)
if isinstance(fetch, collections.Callable):
if isinstance(fetch, collections.abc.Callable):
return fetch(data)
else:
raise NotImplementedError("Don't know how to fetch '%s' from LP"