def _evaluate_template(template_name, **kwargs):
    global _interpreter
    template_path = template_name
    with open(template_path, 'r') as h:
        _interpreter.invoke('beforeInclude', name=template_path, file=h, locals=kwargs)
        content = h.read()
    try:
        _interpreter.string(content, template_path, kwargs)
    except Exception as e:
        print(f"{e.__class__.__name__} processing template '{template_name}': {e}", file=sys.stderr)
        sys.exit(1)
    _interpreter.invoke('afterInclude')
def _evaluate_template(template_name, **kwargs):
    global _interpreter
    template_path = template_name
    with open(template_path, 'r') as h:
        _interpreter.invoke('beforeInclude', name=template_path, file=h, locals=kwargs)
        content = h.read()
    try:
        _interpreter.string(content, template_path, kwargs)
    except Exception as e:
        print(f"{e.__class__.__name__} processing template '{template_name}': {e}", file=sys.stderr)
        sys.exit(1)
    _interpreter.invoke('afterInclude')