Use check_output instead of run

This is shorter and more readable

Suggested-By: @cdecker
This commit is contained in:
Erik De Smedt 2025-02-20 14:54:10 +10:30 committed by Rusty Russell
parent 03e7a03a09
commit 77989b106f

View file

@ -612,10 +612,8 @@ class LightningD(TailableProc):
self.opts = LIGHTNINGD_CONFIG.copy()
# Query the version of the cln-binary
cln_version_proc = subprocess.run(
[self.executable, "--version"],
stdout=subprocess.PIPE)
self.cln_version = NodeVersion(cln_version_proc.stdout.decode('ascii').strip())
cln_version_proc = subprocess.check_output([self.executable, "--version"])
self.cln_version = NodeVersion(cln_version_proc.decode('ascii').strip())
opts = {
'lightning-dir': lightning_dir,