Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
No flake8 warnings/errors on xrange that uses redis-py _compat variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Grokzen committed Dec 26, 2014
1 parent 44338dc commit 4e8da6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions benchmarks/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def loop(rc, reset_last_key=None):
print("error {0}".format(e))
time.sleep(1)

for i in xrange(last, 1000000000):
for i in xrange(last, 1000000000): # noqa
try:
print("SET foo{0} {1}".format(i, i))
rc.set("foo{0}".format(i), i)
Expand All @@ -42,7 +42,7 @@ def timeit(rc, itterations=50000):
""" Time how long it take to run a number of set/get:s
"""
t0 = time.time()
for i in xrange(0, itterations):
for i in xrange(0, itterations): # noqa
try:
s = "foo{0}".format(i)
rc.set(s, i)
Expand Down
4 changes: 2 additions & 2 deletions rediscluster/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def send_cluster_commands(self, stack, raise_on_error=True, allow_redirections=T

ttl = self.RedisClusterRequestTTL
response = {}
attempt = range(0, len(stack)) if stack else []
attempt = xrange(0, len(stack)) if stack else [] # noqa
ask_slots = {}

while attempt and ttl > 0:
Expand Down Expand Up @@ -239,7 +239,7 @@ def _execute_pipeline(self, connection, commands, raise_on_error):
try:
connection.send_packed_command(all_cmds)
except ConnectionError as e:
return [e for _ in xrange(len(commands))]
return [e for _ in xrange(len(commands))] # noqa

response = []
for args, options in commands:
Expand Down

0 comments on commit 4e8da6f

Please sign in to comment.