]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
[pre-commit.ci] auto fixes from pre-commit.com hooks 1993/head
authorpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Mon, 3 Jun 2024 22:10:44 +0000 (22:10 +0000)
committerpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Mon, 3 Jun 2024 22:10:44 +0000 (22:10 +0000)
for more information, see https://pre-commit.ci

src/jinja2/debug.py
src/jinja2/environment.py
src/jinja2/filters.py
src/jinja2/idtracking.py
src/jinja2/lexer.py
src/jinja2/parser.py
src/jinja2/runtime.py
src/jinja2/sandbox.py
src/jinja2/utils.py

index 9fda24caa475f8b3e9ef2f49c8346d14278f64fe..f85a319eeed3db874d6d9df3f3e23f28d490ae81 100644 (file)
@@ -133,7 +133,7 @@ def get_template_locals(real_locals: t.Mapping[str, t.Any]) -> t.Dict[str, t.Any
     available at that point in the template.
     """
     # Start with the current template context.
-    ctx: "t.Optional[Context]" = real_locals.get("context")
+    ctx: t.Optional[Context] = real_locals.get("context")
 
     if ctx is not None:
         data: t.Dict[str, t.Any] = ctx.get_all().copy()
index 78657c69d9218e3fd4881504f958c1483d0762d1..4e6586e61ba58b3f628900e71367281a2d7dd631 100644 (file)
@@ -1250,7 +1250,7 @@ class Template:
         namespace: t.MutableMapping[str, t.Any],
         globals: t.MutableMapping[str, t.Any],
     ) -> "Template":
-        t: "Template" = object.__new__(cls)
+        t: Template = object.__new__(cls)
         t.environment = environment
         t.globals = globals
         t.name = namespace["name"]
index acd11976e4fc74486025a4e480991cb82e64091a..14208770df9ae138dd9cd32be2551325b59df9a4 100644 (file)
@@ -1116,7 +1116,7 @@ def do_batch(
         {%- endfor %}
         </table>
     """
-    tmp: "t.List[V]" = []
+    tmp: t.List[V] = []
 
     for item in value:
         if len(tmp) == linecount:
index 995ebaa0c8178ddb9e0479e0e9f6d30ed863a785..d6cb635b24a492581c32987ed3b8e5069c573ca7 100644 (file)
@@ -146,7 +146,7 @@ class Symbols:
 
     def dump_stores(self) -> t.Dict[str, str]:
         rv: t.Dict[str, str] = {}
-        node: t.Optional["Symbols"] = self
+        node: t.Optional[Symbols] = self
 
         while node is not None:
             for name in sorted(node.stores):
@@ -159,7 +159,7 @@ class Symbols:
 
     def dump_param_targets(self) -> t.Set[str]:
         rv = set()
-        node: t.Optional["Symbols"] = self
+        node: t.Optional[Symbols] = self
 
         while node is not None:
             for target, (instr, _) in self.loads.items():
index 62b0471a3a6a37c9b17d5042f606f3fa64009d6a..6dc94b67d2c8a474837bfd72d23d86299e521d17 100644 (file)
@@ -329,7 +329,7 @@ class TokenStream:
         filename: t.Optional[str],
     ):
         self._iter = iter(generator)
-        self._pushed: "te.Deque[Token]" = deque()
+        self._pushed: te.Deque[Token] = deque()
         self.name = name
         self.filename = filename
         self.closed = False
index 3bb9981e6eec1b956277398de02b7c4b6fd5f293..817abeccfbf5d44447c720089d3f79b01e003448 100644 (file)
@@ -64,7 +64,7 @@ class Parser:
         self.filename = filename
         self.closed = False
         self.extensions: t.Dict[
-            str, t.Callable[["Parser"], t.Union[nodes.Node, t.List[nodes.Node]]]
+            str, t.Callable[[Parser], t.Union[nodes.Node, t.List[nodes.Node]]]
         ] = {}
         for extension in environment.iter_extensions():
             for tag in extension.tags:
index 0148e4350b434ca5e37324f3849668b34f218bd7..9dcc9d4f666393637f60daa6d1a3f95c29fcdc83 100644 (file)
@@ -172,7 +172,7 @@ class Context:
     ):
         self.parent = parent
         self.vars: t.Dict[str, t.Any] = {}
-        self.environment: "Environment" = environment
+        self.environment: Environment = environment
         self.eval_ctx = EvalContext(self.environment, name)
         self.exported_vars: t.Set[str] = set()
         self.name = name
index 0b4fc12d3479772f15c20ad394aab575fd2a4975..ce276156cb0aea8bfa306044646052a8029b9bcb 100644 (file)
@@ -5,11 +5,11 @@ Useful when the template itself comes from an untrusted source.
 import operator
 import types
 import typing as t
+from _string import formatter_field_name_split  # type: ignore
 from collections import abc
 from collections import deque
 from string import Formatter
 
-from _string import formatter_field_name_split  # type: ignore
 from markupsafe import EscapeFormatter
 from markupsafe import Markup
 
index 7fb76935aa3efbca683b5f6f147e7cdd85a9e869..5c1ff5d7ba751c18c29346b829228e885cd202de 100644 (file)
@@ -428,7 +428,7 @@ class LRUCache:
     def __init__(self, capacity: int) -> None:
         self.capacity = capacity
         self._mapping: t.Dict[t.Any, t.Any] = {}
-        self._queue: "te.Deque[t.Any]" = deque()
+        self._queue: te.Deque[t.Any] = deque()
         self._postinit()
 
     def _postinit(self) -> None: