Browse Source

Use subprocess.run with arguments supported before python 3.7

master
Nils 5 years ago
parent
commit
a7d704f075
  1. 3
      engine/findprograms.py

3
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:

Loading…
Cancel
Save