Skip to content
Myr

add Python version comment

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 9c11dd6 · Browse files · 1 file+3 added−4 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+3 added−4 removed

  • other:+3 added−4 removed

1 file+3 added−4 removed

modified:scripts/generate_identifier_pattern.py+3 added-4 removed
52 unmodified lines
53 return "".join(out)545556def main():57 """Build the regex pattern and write it to58 ``jinja2/_identifier.py``.59 """57 """Build the regex pattern and write it to ``jinja2/_identifier.py``."""58 pattern = build_pattern(collapse_ranges(get_characters()))59 filename = os.path.abspath(60 os.path.join(os.path.dirname(__file__), "..", "src", "jinja2", "_identifier.py")61 )6263 with open(filename, "w", encoding="utf8") as f:64 f.write("# generated by scripts/generate_identifier_pattern.py")65 f.write(f"# Python {sys.version_info[0]}.{sys.version_info[1]}\n")66 f.write("import re\n\n")67 f.write("# generated by scripts/generate_identifier_pattern.py\n")67 f.write("pattern = re.compile(\n")68 f.write(f' r"[\\w{pattern}]+" # noqa: B950\n')69 f.write(")\n")70
3 unmodified lines