[selector] fix iterable detection
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 06 Oct 2010 14:56:20 +0200
changeset 6402 a589df8b9b66
parent 6401 d7f5d873e1b8
child 6404 2013ef8f56e9
[selector] fix iterable detection
selectors.py
--- a/selectors.py	Wed Oct 06 14:04:26 2010 +0200
+++ b/selectors.py	Wed Oct 06 14:56:20 2010 +0200
@@ -486,7 +486,7 @@
     # XXX this selector could be evaluated on startup
     def __init__(self, key, values):
         self._key = key
-        if isinstance(values, basestring):
+        if not isinstance(values, (tuple, list)):
             values = (values,)
         self._values = frozenset(values)
 
@@ -498,6 +498,7 @@
             self._score = req.vreg.config[self._key] in self._values
         return self._score
 
+
 # rset selectors ##############################################################
 
 @objectify_selector