aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2009-11-01 22:21:17 +0000
committerPhilip Jenvey <pjenvey@underboss.org>2009-11-01 22:21:17 +0000
commitf873df2d9d86ce58a7edb3748a1ed87373fa0051 (patch)
tree7723786384c407b425da1f9f49d2cce689e08aee /lib
parent163bf151561fcd03367b48a515ba353701aeeffe (diff)
downloadexternal_python_mako-f873df2d9d86ce58a7edb3748a1ed87373fa0051.tar.gz
external_python_mako-f873df2d9d86ce58a7edb3748a1ed87373fa0051.tar.bz2
external_python_mako-f873df2d9d86ce58a7edb3748a1ed87373fa0051.zip
fix mako function decorators to preserve the original function's name in all
cases
Diffstat (limited to 'lib')
-rw-r--r--lib/mako/runtime.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/mako/runtime.py b/lib/mako/runtime.py
index a75e6d8..ee6c5be 100644
--- a/lib/mako/runtime.py
+++ b/lib/mako/runtime.py
@@ -288,6 +288,11 @@ def _decorate_toplevel(fn):
def go(context, *args, **kw):
def y(*args, **kw):
return render_fn(context, *args, **kw)
+ try:
+ y.__name__ = render_fn.__name__[7:]
+ except TypeError:
+ # < Python 2.4
+ pass
return fn(y)(context, *args, **kw)
return go
return decorate_render