Remove support for Python < 3.6 and Django < 2.2.

This commit is contained in:
Emil Stenström 2021-02-12 21:10:33 +01:00
parent ab7e97658f
commit 2c95b0930f
6 changed files with 22 additions and 67 deletions

View file

@ -4,7 +4,7 @@ from itertools import chain
from django.conf import settings
from django.forms.widgets import MediaDefiningClass
from django.template.base import NodeList
from django.template.base import NodeList, TokenType
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from six import with_metaclass
@ -12,17 +12,6 @@ from six import with_metaclass
# Allow "component.AlreadyRegistered" instead of having to import these everywhere
from django_components.component_registry import AlreadyRegistered, ComponentRegistry, NotRegistered # noqa
# Django < 2.1 compatibility
try:
from django.template.base import TokenType
except ImportError:
from django.template.base import TOKEN_BLOCK, TOKEN_TEXT, TOKEN_VAR
class TokenType:
TEXT = TOKEN_TEXT
VAR = TOKEN_VAR
BLOCK = TOKEN_BLOCK
class Component(with_metaclass(MediaDefiningClass)):