15
0

Accepting request 1160541 from devel:languages:python

- Add python312.patch and build for python 3.12
  gh#Pylons/paginate#19

OBS-URL: https://build.opensuse.org/request/show/1160541
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-paginate?expand=0&rev=3
This commit is contained in:
2024-03-22 14:21:29 +00:00
committed by Git OBS Bridge
3 changed files with 21 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Mar 22 06:42:18 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Add python312.patch and build for python 3.12
gh#Pylons/paginate#19
-------------------------------------------------------------------
Wed Feb 7 08:48:25 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -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}

13
python312.patch Normal file
View File

@@ -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)))