diff --git a/pure_pagination/paginator.py b/pure_pagination/paginator.py index 52f62ec..df9ee39 100644 --- a/pure_pagination/paginator.py +++ b/pure_pagination/paginator.py @@ -10,6 +10,12 @@ PAGE_RANGE_DISPLAYED = PAGINATION_SETTINGS.get("PAGE_RANGE_DISPLAYED", 10) MARGIN_PAGES_DISPLAYED = PAGINATION_SETTINGS.get("MARGIN_PAGES_DISPLAYED", 2) +# range in Python 3.x is xrange from Python 2.x +try: + xrange +except NameError: + xrange = range + class InvalidPage(Exception): pass