diff --git a/python-paginate.spec b/python-paginate.spec index e5825be..ae4f9c3 100644 --- a/python-paginate.spec +++ b/python-paginate.spec @@ -17,7 +17,6 @@ %{?sle15_python_module_pythons} -%global skip_python312 1 Name: python-paginate Version: 0.5.6 Release: 0 @@ -26,6 +25,8 @@ License: MIT URL: https://github.com/Signum/paginate # PyPI tarball does not include tests... Source: https://github.com/Signum/paginate/archive/%{version}.tar.gz#/paginate-%{version}.tar.gz +# PATCH-FIX-OPENSUSE python312.patch gh#Pylons/paginate#19 +Patch0: python312.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} diff --git a/python312.patch b/python312.patch new file mode 100644 index 0000000..a31cc68 --- /dev/null +++ b/python312.patch @@ -0,0 +1,13 @@ +Index: paginate-0.5.6/paginate/__init__.py +=================================================================== +--- paginate-0.5.6.orig/paginate/__init__.py ++++ paginate-0.5.6/paginate/__init__.py +@@ -250,7 +250,7 @@ class Page(list): + first = (self.page - 1) * items_per_page + last = first + items_per_page + self.items = list(self.collection[first:last]) +- except TypeError: ++ except (TypeError, KeyError): + raise TypeError("Your collection of type {} cannot be handled " + "by paginate.".format(type(self.collection))) +