# HG changeset patch # User Thierry Florac # Date 1529053153 -7200 # Node ID 00af28a2352dc1643ad77c217f34aca71ac5cf57 # Parent c0db0561ded3936ab9f2615c2c2d84e2cdf45f1d Check if adapter factory is a class diff -r c0db0561ded3 -r 00af28a2352d src/pyams_utils/adapter.py --- a/src/pyams_utils/adapter.py Thu Jun 14 17:32:18 2018 +0200 +++ b/src/pyams_utils/adapter.py Fri Jun 15 10:59:13 2018 +0200 @@ -27,6 +27,8 @@ import venusian +from inspect import isclass + # import interfaces from zope.annotation.interfaces import IAnnotations @@ -158,7 +160,7 @@ elif factory is None: return None else: - if issubclass(factory, Interface): + if isclass(factory) and issubclass(factory, Interface): factory = get_object_factory(factory) assert factory is not None, "Missing object factory" adapter = annotations[key] = factory()