]> git.ipfire.org Git - thirdparty/jinja.git/commit
Change environment cache key construction 585/head
authorpgjones <philip.graham.jones@googlemail.com>
Sat, 21 May 2016 15:17:21 +0000 (16:17 +0100)
committerpgjones <philip.graham.jones@googlemail.com>
Sat, 21 May 2016 15:21:22 +0000 (16:21 +0100)
commit1a61008d61cff5b6c95f7b7298e47f2b18685247
tree90b5f602c6748c7ba87564a6d4d446fb56d1c5b0
parent042dadda53120176100241422f93a42238779d40
Change environment cache key construction

Changing from a tuple of the loader ID and template name to a weakref
to the loader and the template name should avoid situations whereby
the loader has changed, yet the cached templates are returned. This
would occur if the id of the new loader matches the old. A weakref is
preferred over a direct reference so that the loader can be garbaged
collected.
jinja2/environment.py
tests/test_loader.py