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

bage at linutronix.de bage at linutronix.de
Tue Dec 10 23:31:16 CET 2019


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>
---
 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




More information about the elbe-devel mailing list