[elbe-devel] [PATCH v2 2/5] Python3: change xrange to range
Christian Teklenborg
chris at linutronix.de
Fri Dec 13 12:45:16 CET 2019
Change every xrange to range because Python3 doesn't have an xrange function.
Signed-off-by: Christian Teklenborg <chris at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/aptpkgutils.py | 2 +-
elbepack/log.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
index f39e39c4..d63ebe0c 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -30,7 +30,7 @@ statestring = {
def apt_pkg_md5(pkg):
hashes = pkg._records.hashes
- for i in xrange(len(hashes)):
+ for i in range(len(hashes)):
h = str(hashes[i])
if h.startswith("MD5"):
return h.split(':')[1]
diff --git a/elbepack/log.py b/elbepack/log.py
index 2546a3b7..43e04985 100644
--- a/elbepack/log.py
+++ b/elbepack/log.py
@@ -264,7 +264,7 @@ class AsyncLogging(object):
buff = rest + os.read(self.fd, self.atmost)
j = 0
count = 0
- for i in xrange(len(buff)):
+ for i in range(len(buff)):
if buff[i] == '\n':
self.lines.append(buff[j:i])
count += 1
--
2.20.1
More information about the elbe-devel
mailing list