diff options
author | Javeme <zhangmei.li@easystack.cn> | 2016-01-14 17:56:01 +0800 |
---|---|---|
committer | Javeme <zhangmei.li@easystack.cn> | 2016-01-14 18:05:24 +0800 |
commit | 5ff2dfcbb7a45a9181baaec15ce974004edfc50d (patch) | |
tree | cf2d91772f767104447c47e4963d03614271729a /tools/simulator.py | |
parent | 62fc6ab094ade4ea6e1453e0c169b20602555af4 (diff) | |
download | oslo-messaging-5ff2dfcbb7a45a9181baaec15ce974004edfc50d.tar.gz |
py3: Replaces xrange() with six.moves.range()
Since xrange has been removed in Python 3, this patch let's replace xrange()
with six.moves.range() to provide py3 compatibility.
Change-Id: I85e0748786867334756a51dcb834f84ffd1e55a7
Diffstat (limited to 'tools/simulator.py')
-rwxr-xr-x | tools/simulator.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/simulator.py b/tools/simulator.py index 0bc0c3b..abe8e54 100755 --- a/tools/simulator.py +++ b/tools/simulator.py @@ -19,6 +19,7 @@ import datetime import logging import os import random +import six import string import sys import threading @@ -261,7 +262,7 @@ def send_msg(c_id, transport, target, wait_after_msg, timeout, is_cast, client.send_msg() else: LOG.debug("Sending %d messages using client %d", messages_count, c_id) - for _ in xrange(0, messages_count): + for _ in six.moves.range(0, messages_count): client.send_msg() LOG.debug("Client %d has sent %d messages", c_id, messages_count) |