From a7d704f075518326365bf23763abeeb166bc9628 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Mon, 20 Apr 2020 12:32:57 +0200 Subject: [PATCH] Use subprocess.run with arguments supported before python 3.7 --- engine/findprograms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/findprograms.py b/engine/findprograms.py index 4d2cfe6..6aeadbf 100644 --- a/engine/findprograms.py +++ b/engine/findprograms.py @@ -80,7 +80,8 @@ class SupportedProgramsDatabase(object): executablePaths = [pathlib.Path(p) for p in os.environ["PATH"].split(":")] for path in executablePaths: command = f"grep -iRsnl {path} -e /nsm/server/announce" - completedProcess = subprocess.run(command, capture_output=True, text=True, shell=True) + #Py>=3.7 completedProcess = subprocess.run(command, capture_output=True, text=True, shell=True) + completedProcess = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True) for fullPath in completedProcess.stdout.split(): exe = pathlib.Path(fullPath).relative_to(path) if not str(exe) in self.blacklist: