Cache the target argspec in formparams.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Jun 2013 05:48:34 +0000 (07:48 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 27 Jun 2013 05:48:34 +0000 (07:48 +0200)
wrw/util.py

index aea3037..4fad6e9 100644 (file)
@@ -8,9 +8,9 @@ def wsgiwrap(callable):
     return wrapper
 
 def formparams(callable):
+    spec = inspect.getargspec(callable)
     def wrapper(req):
         data = form.formdata(req)
-        spec = inspect.getargspec(callable)
         args = dict(data.items())
         args["req"] = req
         if not spec.keywords: