From eefada10f8fa0ce5312595dbada4da8bbdf40423 Mon Sep 17 00:00:00 2001 From: Christopher Grebs Date: Wed, 22 Apr 2015 16:01:47 +0200 Subject: [PATCH] Fix imports for django 1.8 --- django_babel/extract.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django_babel/extract.py b/django_babel/extract.py index ea578d2..f6ea76f 100644 --- a/django_babel/extract.py +++ b/django_babel/extract.py @@ -1,5 +1,10 @@ # -*- coding: utf-8 -*- -from django.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK +try: + from django.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK +except ImportError: + # Django 1.8 moved most stuff to .base + from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK + from django.utils.translation.trans_real import ( inline_re, block_re, endblock_re, plural_re, constant_re) from django.utils.encoding import smart_text