[elbe-devel] [PATCH 1/2] Python3: use integer division

Torben Hohn torben.hohn at linutronix.de
Wed Dec 11 12:10:28 CET 2019


On Tue, Dec 10, 2019 at 11:31:16PM +0100, bage at linutronix.de wrote:
> From: Bastian Germann <bage at linutronix.de>
> 
> The semantics for / division changed in Python3 so we have to use a // integer
> division here.
> 
> Signed-off-by: Bastian Germann <bage at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/init/Makefile.mako    | 2 +-
>  elbepack/init/preseed.cfg.mako | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/init/Makefile.mako b/elbepack/init/Makefile.mako
> index 39e1cd558..87ec10ad2 100644
> --- a/elbepack/init/Makefile.mako
> +++ b/elbepack/init/Makefile.mako
> @@ -10,7 +10,7 @@ import multiprocessing
>  from elbepack.filesystem import size_to_int
>  
>  max_cpus = int(prj.text('max-cpus', default=defs, key='max-cpus'))
> -memory = size_to_int(prj.text('mem', default=defs, key='mem')) / 1024 / 1024
> +memory = size_to_int(prj.text('mem', default=defs, key='mem')) // 1024 // 1024
>  %>
>  
>  MEMSIZE?=${memory}
> diff --git a/elbepack/init/preseed.cfg.mako b/elbepack/init/preseed.cfg.mako
> index a4784b5fb..4b9e5461e 100644
> --- a/elbepack/init/preseed.cfg.mako
> +++ b/elbepack/init/preseed.cfg.mako
> @@ -8,7 +8,7 @@
>  <%
>    from elbepack.version import elbe_version, elbe_initvm_packagelist
>    from elbepack.filesystem import size_to_int
> -  swap = size_to_int(prj.text('swap-size', default=defs, key='swap-size')) / 1024 / 1024
> +  swap = size_to_int(prj.text('swap-size', default=defs, key='swap-size')) // 1024 // 1024
>  %>
>  d-i keyboard-configuration/layoutcode string us
>  d-i keyboard-configuration/xkb-keymap select us
> -- 
> 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