nicer deprecation messages stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 30 Sep 2009 17:32:29 +0200
branchstable
changeset 3533 88ceed15a3d3
parent 3532 df045bc51d00
child 3534 81cfec545e1b
nicer deprecation messages
web/formfields.py
--- a/web/formfields.py	Wed Sep 30 17:32:03 2009 +0200
+++ b/web/formfields.py	Wed Sep 30 17:32:29 2009 +0200
@@ -181,8 +181,8 @@
         try:
             return widget.render(form, self, renderer)
         except TypeError:
-            warn('widget.render now take the renderer as third argument, please update %s implementation'
-                 % widget.__class__.__name__, DeprecationWarning)
+            warn('[3.3] %s: widget.render now take the renderer as third argument, '
+                 'please update implementation' % widget, DeprecationWarning)
             return widget.render(form, self)
 
     def vocabulary(self, form):
@@ -193,7 +193,7 @@
                 try:
                     vocab = self.choices(form=form)
                 except TypeError:
-                    warn('vocabulary method (eg field.choices) should now take '
+                    warn('[3.3] vocabulary method (eg field.choices) should now take '
                          'the form instance as argument', DeprecationWarning)
                     vocab = self.choices(req=form.req)
             else: