From 24e514f00716cf4dd5fae2930d5f32e59bde2422 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Tue, 4 Jun 2013 15:21:56 +0200 Subject: [PATCH] Try to unwrap functions passed to funplex. --- wrw/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wrw/util.py b/wrw/util.py index e601be3..4306e9b 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -25,8 +25,12 @@ def formparams(callable): return wrapper def funplex(*funs, **nfuns): + def unwrap(fun): + while hasattr(fun, "__wrapped__"): + fun = fun.__wrapped__ + return fun dir = {} - dir.update(((fun.__name__, fun) for fun in funs)) + dir.update(((unwrap(fun).__name__, fun) for fun in funs)) dir.update(nfuns) def handler(req): if req.pathinfo == "": -- 2.11.0