Skip to content

Commit

Permalink
build.py: fix issues with os.walk() and bytes/string encoding
Browse files Browse the repository at this point in the history
generator.next() is no longer valid in Python 3

bytes object has to be decoded to string before use

Signed-off-by: Thomas Staudinger <[email protected]>
  • Loading branch information
Staudey committed Jun 17, 2024
1 parent 0e1b796 commit 9e84f99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pisi/operations/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9e84f99

Please sign in to comment.