Skip to content

Commit

Permalink
Another py3 fix for xrange
Browse files Browse the repository at this point in the history
  • Loading branch information
bufke committed Jun 18, 2015
1 parent b726bf8 commit c9f3c77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion badgify/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
except ImportError:
from django.utils.importlib import import_module

try: # 2.x
_range = xrange
except NameError: # 3.x
_range = range

from . import settings

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -116,7 +121,7 @@ def chunks(l, n):
"""
Yields successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
for i in _range(0, len(l), n):
yield l[i:i + n]


Expand Down

0 comments on commit c9f3c77

Please sign in to comment.