fix _instantiate_selector() mini bug (make sure obj is a class before calling issubclass) tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Tue, 17 Feb 2009 23:46:48 +0100
branchtls-sprint
changeset 727 30fe8f5afbd8
parent 726 88a74f590986
child 728 a95b284150d1
fix _instantiate_selector() mini bug (make sure obj is a class before calling issubclass)
vregistry.py
--- a/vregistry.py	Tue Feb 17 23:45:51 2009 +0100
+++ b/vregistry.py	Tue Feb 17 23:46:48 2009 +0100
@@ -653,7 +653,7 @@
     """
     if isinstance(selector, types.FunctionType):
         return objectify_selector(selector)()
-    if issubclass(selector, Selector):
+    if isinstance(selector, type) and issubclass(selector, Selector):
         return selector()
     return selector