12.08.2023 12:11, Akihiko Odaki wrote:
subprocess.check_output() is a more concise way to execute a subprocess
here.

Signed-off-by: Akihiko Odaki <akihiko.od...@daynix.com>
---
Based-on: <20230812061540.5398-1-akihiko.od...@daynix.com>
("[PATCH] meson: Fix MESONINTROSPECT parsing")

  scripts/symlink-install-tree.py | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
index b72563895c..56d603588f 100644
--- a/scripts/symlink-install-tree.py
+++ b/scripts/symlink-install-tree.py
@@ -15,8 +15,7 @@ def destdir_join(d1: str, d2: str) -> str:
      return str(PurePath(d1, *PurePath(d2).parts[1:]))
introspect = os.environ.get('MESONINTROSPECT')
-out = subprocess.run([*shlex.split(introspect), '--installed'],
-                     stdout=subprocess.PIPE, check=True).stdout
+out = subprocess.check_output([*shlex.split(introspect), '--installed'])
  for source, dest in json.loads(out).items():
      bundle_dest = destdir_join('qemu-bundle', dest)
      path = os.path.dirname(bundle_dest)

Yes, this works too and is shorter and easier to read.

Reviewed-by: Michael Tokarev <m...@tls.msk.ru>
Tested-by: Michael Tokarev <m...@tls.msk.ru>

Thanks!

/mjt

Reply via email to