merge default doc-dc
authorDamien Correia
Fri, 15 Jun 2018 14:12:02 +0200
branchdoc-dc
changeset 267 6d2469d780f7
parent 266 b63d9050929d (current diff)
parent 197 00af28a2352d (diff)
child 268 34af60bf1683
merge default
--- 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()