]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
add Python version comment
authorDavid Lord <davidism@gmail.com>
Wed, 28 May 2025 19:09:42 +0000 (12:09 -0700)
committerDavid Lord <davidism@gmail.com>
Wed, 28 May 2025 19:09:42 +0000 (12:09 -0700)
scripts/generate_identifier_pattern.py

index 7fc64aed093f04466a9f6e93d76520663c342d29..2009c17a4417b725d09da9925b9ef4c598431506 100755 (executable)
@@ -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")