From 0920ac24a70df517afcf823b73ea58a1985fd44e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 6 Dec 2012 23:12:32 -0500 Subject: make _backframes work like _depth (but still leave undocumented) --- pyramid/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyramid/util.py b/pyramid/util.py index ca7f5951c..a8f750a46 100644 --- a/pyramid/util.py +++ b/pyramid/util.py @@ -471,8 +471,9 @@ def viewdefaults(wrapped): view = self.maybe_dotted(view) if inspect.isclass(view): defaults = getattr(view, '__view_defaults__', {}).copy() + if not '_backframes' in kw: + kw['_backframes'] = 1 # for action_method defaults.update(kw) - defaults['_backframes'] = 3 # for action_method return wrapped(self, *arg, **defaults) return functools.wraps(wrapped)(wrapper) @@ -498,7 +499,7 @@ def action_method(wrapped): self._ainfo = [] info = kw.pop('_info', None) # backframes for outer decorators to actionmethods - backframes = kw.pop('_backframes', 2) + backframes = kw.pop('_backframes', 0) + 2 if is_nonstr_iter(info) and len(info) == 4: # _info permitted as extract_stack tuple info = ActionInfo(*info) -- cgit v1.2.3