summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-05-04 12:19:57 +0100
committerAndrew Bartlett <abartlet@samba.org>2018-05-12 21:38:17 +0200
commit504fca732a3ed0865c39772767ee520f99a93cad (patch)
tree5d7f4e845668b8f9868d2d97f614652ac63b157b /python
parent5f330840d0479f9a352d19b15159c10efce9d862 (diff)
downloadsamba-504fca732a3ed0865c39772767ee520f99a93cad.tar.gz
samba-504fca732a3ed0865c39772767ee520f99a93cad.tar.bz2
samba-504fca732a3ed0865c39772767ee520f99a93cad.zip
samba_tool: replace xrange -> range
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/netcmd/dns.py6
-rw-r--r--python/samba/netcmd/user.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index 8bd6a9bf8a0..a0e92cf8dd9 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -140,7 +140,7 @@ def ip4_array_string(array):
ret = []
if not array:
return ret
- for i in xrange(array.AddrCount):
+ for i in range(array.AddrCount):
addr = inet_ntop(AF_INET, pack('I', array.AddrArray[i]))
ret.append(addr)
return ret
@@ -150,7 +150,7 @@ def dns_addr_array_string(array):
ret = []
if not array:
return ret
- for i in xrange(array.AddrCount):
+ for i in range(array.AddrCount):
if array.AddrArray[i].MaxSa[0] == 0x02:
x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[4:8]
addr = inet_ntop(AF_INET, x)
@@ -523,7 +523,7 @@ def dns_record_match(dns_conn, server, zone, name, record_type, data):
elif record_type == dnsp.DNS_TYPE_TXT:
if rec.data.count == urec.data.count:
found = True
- for i in xrange(rec.data.count):
+ for i in range(rec.data.count):
found = found and \
(rec.data.str[i].str == urec.data.str[i].str)
diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index f849e6ee837..bfe2684e938 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -2027,7 +2027,7 @@ samba-tool user syncpasswords --terminate \\
if self.lockfd != -1:
got_exclusive = False
# Try 5 times to get the exclusiv lock.
- for i in xrange(0, 5):
+ for i in range(0, 5):
try:
fcntl.lockf(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
got_exclusive = True