From 9e5d08326842b9ee0070794639faad72fed72ff6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 29 Nov 2010 12:16:17 +0100 Subject: [PATCH] Should work for cpython and pypy now (if the latter is fixed) --- jinja2/debug.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/jinja2/debug.py b/jinja2/debug.py index 80ee2e7..2f46c22 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -39,17 +39,15 @@ class TracebackFrameProxy(object): self.tb = tb self._tb_next = None - def _set_tb_next(self, next): + @property + def tb_next(self): + return self._tb_next + + def set_next(self, next): if tb_set_next is not None: tb_set_next(self.tb, next and next.tb or None) self._tb_next = next - def _get_tb_next(self): - return self._tb_next - - tb_next = property(_get_tb_next, _set_tb_next) - del _get_tb_next, _set_tb_next - @property def is_jinja_frame(self): return '__jinja_template__' in self.tb.tb_frame.f_globals @@ -80,9 +78,9 @@ class ProcessedTraceback(object): prev_tb = None for tb in self.frames: if prev_tb is not None: - prev_tb._tb_next = tb + prev_tb.set_next(tb) prev_tb = tb - prev_tb._tb_next = None + prev_tb.set_next(None) def render_as_text(self, limit=None): """Return a string with the traceback.""" -- 2.26.2