From 9e84f99bf304eb1ee44b134a4351416babca1e53 Mon Sep 17 00:00:00 2001 From: Thomas Staudinger Date: Mon, 17 Jun 2024 20:17:15 +0200 Subject: [PATCH] build.py: fix issues with os.walk() and bytes/string encoding generator.next() is no longer valid in Python 3 bytes object has to be decoded to string before use Signed-off-by: Thomas Staudinger --- pisi/operations/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index aa8a481..a30f70c 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -725,7 +725,7 @@ def pkg_src_dir(self): # still not exists? so try first from dirnames returned by os.walk # usualy archives contains one root dir src_dir = util.join_path( - self.pkg_work_dir(), os.walk(self.pkg_work_dir()).next()[1][0] + self.pkg_work_dir(), next(os.walk(self.pkg_work_dir()))[1][0] ) if self.get_state() == "unpack": ctx.ui.debug("Setting WorkDir to %s" % src_dir) @@ -1470,7 +1470,7 @@ def accumulate_dependencies(self, path, emul32=False): # Currently on Solus this is the same thing as /usr/lib. valid_libs.update(["/usr/lib64", "/lib64"]) - for line in out.split("\n"): + for line in out.decode().split("\n"): line = line.strip() g = self.shared_lib.match(line) if g: