From 8699a35290545298348d97b15a674c6aa55b583f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 29 Jun 2024 10:35:45 -0400 Subject: [PATCH] Change back to Popen Signed-off-by: Jean-Christophe Morin --- src/rez/system.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/rez/system.py b/src/rez/system.py index ef1ae9e8f..8486a71af 100644 --- a/src/rez/system.py +++ b/src/rez/system.py @@ -86,17 +86,9 @@ def shell(self): # print an error message: "process ID out of range". try: args = ['ps', '-o', 'args=', '-p', str(parent_pid)] - finished_proc = sp.run( - args, - capture_output=True, - check=True, - text=True, - ) - output = finished_proc.stdout - shell = os.path.basename( - output.strip().split()[0]).replace( - '-', '' - ) + proc = sp.Popen(args, stdout=sp.PIPE, text=True) + output = proc.communicate()[0] + shell = os.path.basename(output.strip().split()[0]).replace('-', '') except Exception: pass