Uglified util.formparams to be 2.5-compatible as well.
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 8 Aug 2012 07:14:47 +0000 (09:14 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 8 Aug 2012 07:14:47 +0000 (09:14 +0200)
wrw/util.py

index 727660754ab80317ed777c2d86524840dbb7900d..2e3a7954bc53877705facd1d8de6234af045d94a 100644 (file)
@@ -13,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