OpenQuizz
Une application de gestion des contenus pédagogiques
jinja2.debug Namespace Reference

Data Structures

class  _CTraceback
 

Functions

def rewrite_traceback_stack (source=None)
 
def fake_traceback (exc_value, tb, filename, lineno)
 
def get_template_locals (real_locals)
 
def tb_set_next (tb, tb_next)
 

Function Documentation

◆ fake_traceback()

def jinja2.debug.fake_traceback (   exc_value,
  tb,
  filename,
  lineno 
)
Produce a new traceback object that looks like it came from the
template source instead of the compiled code. The filename, line
number, and location name will point to the template, and the local
variables will be the current template context.

:param exc_value: The original exception to be re-raised to create
    the new traceback.
:param tb: The original traceback to get the local variables and
    code info from.
:param filename: The template filename.
:param lineno: The line number in the template source.

◆ get_template_locals()

def jinja2.debug.get_template_locals (   real_locals)
Based on the runtime locals, get the context that would be
available at that point in the template.

◆ rewrite_traceback_stack()

def jinja2.debug.rewrite_traceback_stack (   source = None)
Rewrite the current exception to replace any tracebacks from
within compiled template code with tracebacks that look like they
came from the template source.

This must be called within an ``except`` block.

:param exc_info: A :meth:`sys.exc_info` tuple. If not provided,
    the current ``exc_info`` is used.
:param source: For ``TemplateSyntaxError``, the original source if
    known.
:return: A :meth:`sys.exc_info` tuple that can be re-raised.

◆ tb_set_next()

def tb_set_next (   tb,
  tb_next 
)