qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] meson: Use subprocess.check_output()


From: Michael Tokarev
Subject: Re: [PATCH] meson: Use subprocess.check_output()
Date: Sat, 12 Aug 2023 12:51:12 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

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.odaki@daynix.com>
---
Based-on: <20230812061540.5398-1-akihiko.odaki@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 <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>

Thanks!

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]