summaryrefslogtreecommitdiff
path: root/qutebrowser
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-05-18 18:29:24 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-05-18 18:31:05 +0200
commit0aa79efbe52e78ab11491c3b2caad453d29e34c0 (patch)
treeb2895a8b1046a5ccad5842d587a309bccfeed4f0 /qutebrowser
parentf74518842f867c4edcd057703c5a035087d60e8a (diff)
downloadqutebrowser-0aa79efbe52e78ab11491c3b2caad453d29e34c0.tar.gz
qutebrowser-0aa79efbe52e78ab11491c3b2caad453d29e34c0.zip
Update jinja.py typing after jinja upgrade
jinja ships its own (more correct) stubs now see https://github.com/python/typeshed/issues/3197
Diffstat (limited to 'qutebrowser')
-rw-r--r--qutebrowser/utils/jinja.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/qutebrowser/utils/jinja.py b/qutebrowser/utils/jinja.py
index 61d8ccdad..a44a0235e 100644
--- a/qutebrowser/utils/jinja.py
+++ b/qutebrowser/utils/jinja.py
@@ -145,7 +145,7 @@ js_environment = jinja2.Environment(loader=Loader('javascript'))
@functools.lru_cache()
def template_config_variables(template: str) -> FrozenSet[str]:
"""Return the config variables used in the template."""
- unvisted_nodes = [environment.parse(template)]
+ unvisted_nodes: List[jinja2.nodes.Node] = [environment.parse(template)]
result: Set[str] = set()
while unvisted_nodes:
node = unvisted_nodes.pop()
@@ -157,11 +157,11 @@ def template_config_variables(template: str) -> FrozenSet[str]:
# For example it's ['ab', 'c', 'd'] for 'conf.d.c.ab'.
attrlist: List[str] = []
while isinstance(node, jinja2.nodes.Getattr):
- attrlist.append(node.attr) # type: ignore[attr-defined]
- node = node.node # type: ignore[attr-defined]
+ attrlist.append(node.attr)
+ node = node.node
if isinstance(node, jinja2.nodes.Name):
- if node.name == 'conf': # type: ignore[attr-defined]
+ if node.name == 'conf':
result.add('.'.join(reversed(attrlist)))
# otherwise, the node is a Name node so it doesn't have any
# child nodes