fix missing import in web.request stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Mon, 09 Aug 2010 11:56:12 +0200
branchstable
changeset 6078 c08e74b0609e
parent 6076 aa7402e998a1
child 6079 bd7e3042791e
fix missing import in web.request
web/request.py
--- a/web/request.py	Fri Aug 06 17:38:45 2010 +0200
+++ b/web/request.py	Mon Aug 09 11:56:12 2010 +0200
@@ -27,6 +27,7 @@
 from datetime import date
 from urlparse import urlsplit
 from itertools import count
+from warnings import warn
 
 from rql.utils import rqlvar_maker
 
@@ -383,7 +384,6 @@
             try:
                 ret = func(req, *args)
             except TypeError:
-                from warnings import warn
                 warn('[3.2] user callback should now take request as argument')
                 ret = func(*args)
             self.unregister_callback(self.pageid, cbname)
@@ -447,7 +447,7 @@
                 name, peid = param.split(':', 1)
             except ValueError:
                 if not param.startswith('__') and param != "eid":
-                    self.warning('param %s mis-formatted', param)
+                    warn('param %s mis-formatted', param)
                 continue
             if peid == eid:
                 value = form[param]