From c79bdac5df6c0b6be04f9ba5dff24402d5eb3e3e Mon Sep 17 00:00:00 2001 From: Gustavo Andres Morero Date: Fri, 30 Jun 2017 15:48:26 -0300 Subject: [PATCH] some updates for py3 support. --- pagination/templatetags/pagination_tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index 691deab..1bb663e 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -25,7 +25,7 @@ def do_autopaginate(parser, token): # Check whether there are any other autopaginations are later in this template expr = lambda obj: (obj.token_type == TOKEN_BLOCK and \ len(obj.split_contents()) > 0 and obj.split_contents()[0] == "autopaginate") - multiple_paginations = len(filter(expr, parser.tokens)) > 0 + multiple_paginations = len(list(filter(expr, parser.tokens))) > 0 split = token.split_contents() as_index = None @@ -239,7 +239,7 @@ def paginate(context, window=DEFAULT_WINDOW, hashtag=''): else: to_return['getvars'] = '' return to_return - except KeyError, AttributeError: + except (KeyError, AttributeError): return {} register.inclusion_tag('pagination/pagination.html', takes_context=True)( -- 2.45.2