Support Django 4.0, drop Django < 2.1, Python < 3.6.
[django-pagination.git] / fnp_django_pagination / templatetags / pagination_tags.py
index 7d41052..015e19c 100644 (file)
@@ -42,10 +42,8 @@ from django.template import (
     loader,
 )
 
-try:
-    from django.template.base import TOKEN_BLOCK
-except ImportError:     # Django < 1.8
-    from django.template import TOKEN_BLOCK
+from django.template.base import TokenType
+TOKEN_BLOCK = TokenType.BLOCK
 
 from django.template.loader import select_template
 from django.utils.text import unescape_string_literal
@@ -195,9 +193,7 @@ class PaginateNode(Node):
         new_context = paginate(context)
         if self.template:
             template_list.insert(0, self.template)
-        return loader.render_to_string(template_list, new_context,
-            context_instance = context)
-
+        return loader.render_to_string(template_list, new_context)
 
 
 def do_paginate(parser, token):