diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py index 8ad08fcd5..cf49b13b1 100644 --- a/tests/hwsim/hwsim_utils.py +++ b/tests/hwsim/hwsim_utils.py @@ -83,7 +83,7 @@ def run_connectivity_test(dev1, dev2, tos, dev1group=False, dev2group=False, cmd = "DATA_TEST_TX ff:ff:ff:ff:ff:ff {} {}".format(addr1, tos) if send_len is not None: cmd += " len=" + str(send_len) - for i in xrange(broadcast_retry_c): + for i in range(broadcast_retry_c): try: if dev1group: dev1.group_request(cmd) @@ -135,7 +135,7 @@ def run_connectivity_test(dev1, dev2, tos, dev1group=False, dev2group=False, cmd = "DATA_TEST_TX ff:ff:ff:ff:ff:ff {} {}".format(addr2, tos) if send_len is not None: cmd += " len=" + str(send_len) - for i in xrange(broadcast_retry_c): + for i in range(broadcast_retry_c): try: if dev2group: dev2.group_request(cmd) @@ -221,7 +221,7 @@ def test_connectivity_p2p_sta(dev1, dev2, dscp=None, tos=None): def test_connectivity_sta(dev1, dev2, dscp=None, tos=None): test_connectivity(dev1, dev2, dscp, tos) -(PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL) = range(4) +(PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL) = list(range(4)) def set_powersave(dev, val): phy = dev.get_driver_status_field("phyname") diff --git a/tests/hwsim/rfkill.py b/tests/hwsim/rfkill.py index fa724ae50..a5e6f523a 100755 --- a/tests/hwsim/rfkill.py +++ b/tests/hwsim/rfkill.py @@ -21,12 +21,12 @@ import os TYPE_WWAN, TYPE_GPS, TYPE_FM, - TYPE_NFC) = range(9) + TYPE_NFC) = list(range(9)) (_OP_ADD, _OP_DEL, _OP_CHANGE, - _OP_CHANGE_ALL) = range(4) + _OP_CHANGE_ALL) = list(range(4)) _type_names = { TYPE_ALL: "all", diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index 26a7521e7..f17a02776 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -368,7 +368,7 @@ def test_wmediumd_path_rann(dev, apdev, params): raise Exception("No captured data found\n") lines = out.splitlines() prev = float(lines[len(lines) - 1]) - for i in reversed(range(1, len(lines) - 1)): + for i in reversed(list(range(1, len(lines) - 1))): now = float(lines[i]) if prev - now < 1.0 or 3.0 < prev - now: raise Exception("RANN interval " + str(prev - now) +