avoid to see the same warning twice, one for 3.6 another for 3.3
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 08 Feb 2010 13:29:23 +0100
changeset 4499 4f741341d96f
parent 4498 ee6362b4618d
child 4506 5b99f4a9f8ef
avoid to see the same warning twice, one for 3.6 another for 3.3
web/formfields.py
--- a/web/formfields.py	Mon Feb 08 13:05:19 2010 +0100
+++ b/web/formfields.py	Mon Feb 08 13:29:23 2010 +0100
@@ -264,11 +264,11 @@
                 else:
                     vocab = self.choices(form=form, field=self, **kwargs)
             except TypeError:
-                warn('[3.6]  %s: choices should now take '
-                     'the form and field as named arguments' % self,
-                     DeprecationWarning)
                 try:
                     vocab = self.choices(form=form, **kwargs)
+                    warn('[3.6]  %s: choices should now take '
+                         'the form and field as named arguments' % self,
+                         DeprecationWarning)
                 except TypeError:
                     warn('[3.3]  %s: choices should now take '
                          'the form and field as named arguments' % self,