python/samba/tests: py2/py3 compatability replace xrange with range
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 11:16:38 +0000 (12:16 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 19:38:16 +0000 (21:38 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dns_forwarder.py
python/samba/tests/samba_tool/user.py

index 028c308239f0b805399be23f2e04fc35bea21400..c9da223739e7db154a8fcf60c60af52542635015 100644 (file)
@@ -186,7 +186,7 @@ class TestDnsForwarding(DNSTest):
                              host, str(port), id])
         self.subprocesses.append(p)
         s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
-        for i in xrange(300):
+        for i in range(300):
             time.sleep(0.05)
             s.connect((host, port))
             try:
index 7e7d74dbfea83dbdaf4d42c291448940cddd0ee0..878b37c31c227be6fbd67e4507553f7f06cf82c0 100644 (file)
@@ -121,7 +121,7 @@ class UserCmdTestCase(SambaToolCmdTest):
             return
 
         def find_package(packages, name, start_idx=0):
-            for i in xrange(start_idx, len(packages)):
+            for i in range(start_idx, len(packages)):
                 if packages[i].name == name:
                     return (i, packages[i])
             return (None, None)