[form] take care to not unicodify None values
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 12 Jul 2010 12:25:19 +0200
changeset 5955 67dfe437bf25
parent 5953 af48c527aea7
child 5959 1ce09206a3a3
[form] take care to not unicodify None values
web/formfields.py
--- a/web/formfields.py	Fri Jul 09 12:48:03 2010 +0200
+++ b/web/formfields.py	Mon Jul 12 12:25:19 2010 +0200
@@ -411,7 +411,7 @@
             vocab = vocab_sort(vocab)
         # XXX pre 3.9 bw compat
         for i, (label, value) in enumerate(vocab):
-            if not isinstance(value, basestring):
+            if value is not None and not isinstance(value, basestring):
                 warn('[3.9] %s: vocabulary value should be an unicode string'
                      % self, DeprecationWarning)
                 vocab[i] = (label, unicode(value))