[elbe-devel] [PATCH 2/5] Python3: change xrange to range

Christian Teklenborg chris at linutronix.de
Fri Dec 6 14:08:46 CET 2019


Change every xrange to range because Python3 doesn't have an xrange function.

Signed-off-by: Christian Teklenborg <chris 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 84dd0dce..3477a561 100644
--- a/elbepack/aptpkgutils.py
+++ b/elbepack/aptpkgutils.py
@@ -23,7 +23,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