mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
jinja2: Fix mypy confusion caused by weird six import.
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import six
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from typing import Any, Dict, List, Optional, Union, Text
|
from typing import Any, Dict, List, Optional, Union, Text
|
||||||
if False:
|
if False:
|
||||||
from mypy_extensions import NoReturn
|
from mypy_extensions import NoReturn
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
from django.utils import six
|
|
||||||
from django.test.signals import template_rendered
|
from django.test.signals import template_rendered
|
||||||
from django.template.backends import jinja2 as django_jinja2
|
from django.template.backends import jinja2 as django_jinja2
|
||||||
from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context
|
from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context
|
||||||
@@ -33,7 +34,7 @@ class Jinja2(django_jinja2.Jinja2):
|
|||||||
super(Jinja2, self).__init__(params, *args, **kwargs)
|
super(Jinja2, self).__init__(params, *args, **kwargs)
|
||||||
|
|
||||||
def get_template(self, template_name):
|
def get_template(self, template_name):
|
||||||
# type: (str) -> Any # should be Template, see https://github.com/python/mypy/issues/2958
|
# type: (str) -> Template
|
||||||
try:
|
try:
|
||||||
return Template(self.env.get_template(template_name),
|
return Template(self.env.get_template(template_name),
|
||||||
self.context_processors,
|
self.context_processors,
|
||||||
|
|||||||
Reference in New Issue
Block a user