[normalize] Correctly check for 0 or None in normalization indexes, closes #241166
authorVincent Michel <vincent.michel@logilab.fr>
Thu, 24 Apr 2014 16:36:57 +0000
changeset 427 5b87b09238f4
parent 424 18df8d345617
child 428 aed668ce06ea
[normalize] Correctly check for 0 or None in normalization indexes, closes #241166
utils/normalize.py
--- a/utils/normalize.py	Wed Apr 09 14:39:10 2014 +0200
+++ b/utils/normalize.py	Thu Apr 24 16:36:57 2014 +0000
@@ -186,7 +186,6 @@
 
      would return u'Hugo, Victor (26 fev 1802 - 22 mai 1885)'
      """
-
     match = re.match(regexp, string)
     return output % match.groupdict()
 
@@ -214,7 +213,7 @@
                     Could be a list or an int
         """
         self.callback = callback
-        if attr_index:
+        if attr_index is not None:
             self.attr_index = attr_index if isinstance(attr_index, (tuple, list)) else (attr_index,)
         else:
             self.attr_index = attr_index