Minimal example:
from jinja2 import DictLoader, Environment
from jinja2.runtime import Context
class MyContext(Context):
pass
class MyEnvironment(Environment):
context_class = MyContext
loader = DictLoader({'base': '{{ foobar }}',
'test': '{% extends "base" %}'})
env = MyEnvironment(loader=loader)
print env.get_template('test').render(foobar='test')
Traceback:
Traceback (most recent call last):
File "test.py", line 16, in <module>
print env.get_template('test').render(foobar='test')
File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/home/adrian/dev/indico/env/lib/python2.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 1, in top-level template code
File "<template>", line 1, in top-level template code
TypeError: resolve_or_missing() takes at least 2 arguments (1 given)
As you can see just having a custom Context class, even without changing anything in there, breaks as soon as the base template contains a variable. This is most likely caused by the metaclass added in c6ddeb7.
Minimal example:
Traceback:
As you can see just having a custom Context class, even without changing anything in there, breaks as soon as the base template contains a variable. This is most likely caused by the metaclass added in c6ddeb7.