Skip to content

Commit

Permalink
Change back to Popen
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
  • Loading branch information
JeanChristopheMorinPerso committed Jun 29, 2024
1 parent 7103dcb commit 8699a35
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/rez/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8699a35

Please sign in to comment.