Skip to content

Commit eefada1

Browse files
committed
Fix imports for django 1.8
1 parent 4bba2ac commit eefada1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

django_babel/extract.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# -*- coding: utf-8 -*-
2-
from django.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
2+
try:
3+
from django.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
4+
except ImportError:
5+
# Django 1.8 moved most stuff to .base
6+
from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
7+
38
from django.utils.translation.trans_real import (
49
inline_re, block_re, endblock_re, plural_re, constant_re)
510
from django.utils.encoding import smart_text

0 commit comments

Comments
 (0)