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 c60a307 commit dbc1137Copy full SHA for dbc1137
django_babel/extract.py
@@ -1,10 +1,10 @@
1
# -*- coding: utf-8 -*-
2
+from django.template.base import Lexer
3
try:
- from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
4
-except ImportError:
5
- # Django 2.1+
6
- from django.template.base import Lexer, TokenType
7
-
+ from django.template.base import TokenType
+except ImportError: # django < 2.1
+ from django.template.base import TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
+else:
8
TOKEN_TEXT = TokenType.TEXT
9
TOKEN_VAR = TokenType.VAR
10
TOKEN_BLOCK = TokenType.BLOCK
0 commit comments