]> git.ipfire.org Git - thirdparty/jinja.git/commit
rewrite traceback rewriting support 1110/head
authorDavid Lord <davidism@gmail.com>
Mon, 2 Dec 2019 20:58:18 +0000 (12:58 -0800)
committerDavid Lord <davidism@gmail.com>
Mon, 2 Dec 2019 20:58:18 +0000 (12:58 -0800)
commitcfb789adc898dba977c256d3ce5842bb43baacfd
tree875ea585675f89d0d53fc866c0490f5521cb960e
parent6c1a62f7776edac2e4402ceafa0e6d9ba12bcedd
rewrite traceback rewriting support

Simplify the `jinja.debug` code.

On Python >= 3.7, `tb_next` is directly assignable. On PyPy, use
transparent proxies only if support is enabled. For cpython < 3.7, use
ctypes to set `tb_next`. Rewrite the ctypes code to use `py_object` and
`pythonapi.Py_IncRef`, which seems to avoid crashing on debug builds.

On Python 3, a rewritten `TemplateSyntaxError` would retain the frames
from the compiler functions for some reason. Clear these so the template
source is the last thing in the traceback.
CHANGES.rst
jinja2/asyncsupport.py
jinja2/debug.py
jinja2/environment.py
jinja2/nativetypes.py
tests/test_debug.py