From: Armin Ronacher Date: Mon, 18 Apr 2011 14:27:14 +0000 (+0200) Subject: Catch down errors caused by tb_set_next. This fixes #22 X-Git-Tag: 2.6~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75ffeb6b022b6bcccfd75ea2b20418db6623cde9;p=jinja2.git Catch down errors caused by tb_set_next. This fixes #22 --- diff --git a/jinja2/debug.py b/jinja2/debug.py index f1cc3bc..2af2222 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -45,7 +45,13 @@ class TracebackFrameProxy(object): def set_next(self, next): if tb_set_next is not None: - tb_set_next(self.tb, next and next.tb or None) + try: + tb_set_next(self.tb, next and next.tb or None) + except Exception: + # this function can fail due to all the hackery it does + # on various python implementations. We just catch errors + # down and ignore them if necessary. + pass self._tb_next = next @property