python3: Use zip from the six.moves package.

This commit is contained in:
Tim Abbott 2016-01-23 20:21:28 -08:00
parent 757e89260e
commit bd0918cd5a
1 changed files with 2 additions and 3 deletions

View File

@ -2,13 +2,12 @@ from __future__ import absolute_import
from django.conf import settings
from zerver.lib.redis_utils import get_redis_client
from six.moves import zip
import redis
import time
import logging
from itertools import izip
# Implement a rate-limiting scheme inspired by the one described here, but heavily modified
# http://blog.domaintools.com/2013/04/rate-limiting-with-redis/
@ -131,7 +130,7 @@ def is_ratelimited(user, domain='all'):
return True, blocking_ttl
now = time.time()
for timestamp, (range_seconds, num_requests) in izip(rule_timestamps, rules):
for timestamp, (range_seconds, num_requests) in zip(rule_timestamps, rules):
# Check if the nth timestamp is newer than the associated rule. If so,
# it means we've hit our limit for this rule
if timestamp is None: