Commit 07ad73ca authored by 林檎's avatar 林檎

Merge branch 'fix/syntax-python3-20170305' into travis

parents dc985e76 297a08cd
...@@ -248,6 +248,8 @@ class Pagination(object): ...@@ -248,6 +248,8 @@ class Pagination(object):
def iter_pages(self, left_edge=2, left_current=2, def iter_pages(self, left_edge=2, left_current=2,
right_current=5, right_edge=2): right_current=5, right_edge=2):
last = 0 last = 0
if sys.version_info.major >= 3:
xrange = range
for num in xrange(1, self.pages + 1): # ToDo: can be simplified 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) \ if num <= left_edge or (num > self.page - left_current - 1 and num < self.page + right_current) \
or num > self.pages - right_edge: or num > self.pages - right_edge:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment