From 297a08cd5f6b7b69181c160d3645e84c316a781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=AA=8E?= Date: Mon, 6 Mar 2017 19:47:58 +0800 Subject: [PATCH] xrange fix range to xrange --- cps/web.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cps/web.py b/cps/web.py index fc3e81ad..a303411f 100755 --- a/cps/web.py +++ b/cps/web.py @@ -248,6 +248,8 @@ class Pagination(object): def iter_pages(self, left_edge=2, left_current=2, right_current=5, right_edge=2): last = 0 + if sys.version_info.major >= 3: + xrange = range for num in xrange(1, self.pages + 1): # ToDo: can be simplified if num <= left_edge or (num > self.page - left_current - 1 and num < self.page + right_current) \ or num > self.pages - right_edge: