Merge branch 'master' into jython
[wrw.git] / wrw / util.py
index 5ee002b..2e3a795 100644 (file)
@@ -1,3 +1,4 @@
+from __future__ import with_statement
 import inspect
 import req, dispatch, session, form
 
@@ -12,9 +13,9 @@ def formparams(callable):
         spec = inspect.getargspec(callable)
         args = dict(data.items())
         args["req"] = req
-        if not spec.keywords:
+        if not spec[2]:
             for arg in list(args):
-                if arg not in spec.args:
+                if arg not in spec[0]:
                     del args[arg]
         return callable(**args)
     return wrapper