From dac51930e832537fecf3ba439bbfa90819c0fa4f Mon Sep 17 00:00:00 2001 From: Erik De Smedt Date: Thu, 20 Feb 2025 14:54:10 +1030 Subject: [PATCH] Use `check_output` instead of `run` This is shorter and more readable Suggested-By: @cdecker --- contrib/pyln-testing/pyln/testing/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index afef30c20..4ca46e837 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -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,