Skip to content
Myr

increment bytecode cache version

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent c775bb9 · Browse files · 1 file+6 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−9 removed

  • other:+6 added−9 removed

1 file+6 added−9 removed

modified:src/jinja2/bccache.py+6 added-9 removed
21 unmodified lines
22from ._compat import pickle23from ._compat import text_type24from .utils import open_if_exists2526bc_version = 32728# magic version used to only change with new jinja versions. With 2.629# we change this to also take Python version changes into account. The30# reason for this is that Python tends to segfault if fed earlier bytecode31# versions because someone thought it would be a good idea to reuse opcodes32# or make Python incompatible with earlier versions.26bc_version = 427# Magic bytes to identify Jinja bytecode cache files. Contains the28# Python major and minor version to avoid loading incompatible bytecode29# if a project upgrades its Python version.30bc_magic = (34 "j2".encode("ascii")31 b"j2"32 + pickle.dumps(bc_version, 2)36 + pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1])33 + pickle.dumps((sys.version_info[0] << 24) | sys.version_info[1], 2)34)353637class Bucket(object):
313 unmodified lines