diff mbox series

chrpath.bbclass: fix Darwin support

Message ID 20240112153308.2567611-1-ecordonnier@snap.com
State Accepted, archived
Commit 0abaa7bf7f7d9a5ac96e6fdbe99334cb2fb0e4db
Headers show
Series chrpath.bbclass: fix Darwin support | expand

Commit Message

Etienne Cordonnier Jan. 12, 2024, 3:33 p.m. UTC
From: Etienne Cordonnier <ecordonnier@snap.com>

Ported from the meta-darwin layer:
The call to out.split("\n") expects a string, thus the parameter text=True is
needed (otherwise Popen returns a bytes object).

Note that "text" is just a more readable alias for universal_newlines.

Signed-off-by: Dominik Schnitzer <dominik@snap.com>
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 meta/classes/chrpath.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 1aecb4df66..16729dcf61 100644
--- a/meta/classes/chrpath.bbclass
+++ b/meta/classes/chrpath.bbclass
@@ -62,7 +62,7 @@  def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlin
 def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d, break_hardlinks = False):
     import subprocess as sub
 
-    p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+    p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE, text=True)
     out, err = p.communicate()
     # If returned successfully, process stdout for results
     if p.returncode != 0: