We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e66e38 commit be6ced4Copy full SHA for be6ced4
sphinx_jinja2_compat/__init__.py
@@ -27,6 +27,7 @@
27
#
28
29
# stdlib
30
+import sys
31
from typing import Any, Callable, List, TypeVar
32
33
__all__: List[str] = []
@@ -67,5 +68,8 @@ def environmentfilter(f: F) -> F:
67
68
def contextfunction(f: F) -> F:
69
return jinja2.utils.pass_context(f)
70
- jinja2.utils.contextfunction = contextfunction # type: ignore[attr-defined]
71
- jinja2.contextfunction = contextfunction # type: ignore[attr-defined]
+# This all has to be up here so it's triggered first.
72
+if sys.version_info >= (3, 10):
73
+ # stdlib
74
+ import types
75
+ types.Union = types.UnionType
0 commit comments