From 9c88317aeaee9ce0b0d420c3b3344028517bb4bd Mon Sep 17 00:00:00 2001 From: Marcin Lulek Date: Sun, 25 Aug 2024 15:09:24 +0200 Subject: [PATCH] fixes #19 solve incorrect type handling on python 3.12 --- paginate/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paginate/__init__.py b/paginate/__init__.py index 7b9d9a1..52e2c3a 100644 --- a/paginate/__init__.py +++ b/paginate/__init__.py @@ -259,7 +259,7 @@ def __init__( first = (self.page - 1) * items_per_page last = first + items_per_page self.items = list(self.collection[first:last]) - except TypeError: + except (KeyError, TypeError) as exc: raise TypeError( "Your collection of type {} cannot be handled " "by paginate.".format(type(self.collection))