forked from pool/python-paginate
gh#Pylons/paginate#19 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-paginate?expand=0&rev=5
14 lines
611 B
Diff
14 lines
611 B
Diff
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)))
|
|
|