diff options
| -rw-r--r-- | pyramid/util.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pyramid/util.py b/pyramid/util.py index 1ae7e6afc..12eae3626 100644 --- a/pyramid/util.py +++ b/pyramid/util.py @@ -554,7 +554,14 @@ def action_method(wrapped): info = ActionInfo(*info) if info is None: try: - f = traceback.extract_stack(limit=3) + f = traceback.extract_stack(limit=4) + + # Work around a Python 3.5 issue whereby it would insert an + # extra stack frame. This should no longer be necessary in + # Python 3.5.1 + last_frame = ActionInfo(*f[-1]) + if last_frame.function == 'extract_stack': + f.pop() info = ActionInfo(*f[-backframes]) except: # pragma: no cover info = ActionInfo(None, 0, '', '') |
