From aa883bab284d1ecec18ccc6296341ea6670aa8f1 Mon Sep 17 00:00:00 2001 From: David Grant Date: Tue, 30 Jan 2024 13:05:40 -0800 Subject: [PATCH] Work around subprocess.run not having a capture_output param in old Py3 versions. https://stackoverflow.com/questions/53209127/subprocess-unexpected-keyword-argument-capture-output --- cattle/cattle_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cattle/cattle_cli.py b/cattle/cattle_cli.py index 614b0fd..093f880 100644 --- a/cattle/cattle_cli.py +++ b/cattle/cattle_cli.py @@ -114,7 +114,8 @@ def transfer(self, archive: str, executable: str, exec_dir: str): shutil.copy(executable, exec_dir) def exec_command(self, cmd: str): - proc = subprocess.run(cmd, capture_output=True, check=True, shell=True) + proc = subprocess.run(cmd, check=True, shell=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) return proc.stdout.decode().strip() class HostRunner: