From: David Lord Date: Wed, 28 May 2025 19:09:42 +0000 (-0700) Subject: add Python version comment X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0547cd6c5871b3d2e1fa6eaaa9c1f3b5d3a2bd14;p=thirdparty%2Fjinja.git add Python version comment --- diff --git a/scripts/generate_identifier_pattern.py b/scripts/generate_identifier_pattern.py index 7fc64aed..2009c17a 100755 --- a/scripts/generate_identifier_pattern.py +++ b/scripts/generate_identifier_pattern.py @@ -54,17 +54,16 @@ def build_pattern(ranges): def main(): - """Build the regex pattern and write it to - ``jinja2/_identifier.py``. - """ + """Build the regex pattern and write it to ``jinja2/_identifier.py``.""" pattern = build_pattern(collapse_ranges(get_characters())) filename = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "src", "jinja2", "_identifier.py") ) with open(filename, "w", encoding="utf8") as f: + f.write("# generated by scripts/generate_identifier_pattern.py") + f.write(f"# Python {sys.version_info[0]}.{sys.version_info[1]}\n") f.write("import re\n\n") - f.write("# generated by scripts/generate_identifier_pattern.py\n") f.write("pattern = re.compile(\n") f.write(f' r"[\\w{pattern}]+" # noqa: B950\n') f.write(")\n")