--- a/src/pyams_utils/adapter.py Thu Jun 14 17:49:54 2018 +0200
+++ b/src/pyams_utils/adapter.py Fri Jun 15 14:12:02 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()