[elbe-devel] [PATCH 2/5] Python3: change xrange to range
Torben Hohn
torben.hohn at linutronix.de
Fri Dec 6 15:59:36 CET 2019
On Fri, Dec 06, 2019 at 02:08:46PM +0100, Christian Teklenborg wrote:
> 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 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
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list