From: Yasuhisa Yamazaki <1@yasu21.net> Date: Tue, 19 May 2015 09:43:51 +0000 (+0900) Subject: Import TOKEN_BLOCK from django.template.base if Django version is greater than or... X-Git-Tag: release-2.1~1^2 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/862f40cfd7a0b8df475b5542c518d7916ce6391e Import TOKEN_BLOCK from django.template.base if Django version is greater than or equal to 1.8. --- diff --git a/linaro_django_pagination/templatetags/pagination_tags.py b/linaro_django_pagination/templatetags/pagination_tags.py index 45857f9..da22e95 100644 --- a/linaro_django_pagination/templatetags/pagination_tags.py +++ b/linaro_django_pagination/templatetags/pagination_tags.py @@ -37,11 +37,16 @@ from django.template import ( Context, Library, Node, - TOKEN_BLOCK, TemplateSyntaxError, Variable, loader, ) + +try: + from django.template.base import TOKEN_BLOCK +except ImportError: # Django < 1.8 + from django.template import TOKEN_BLOCK + from django.template.loader import select_template from django.utils.text import unescape_string_literal