Skip to content

Commit

Permalink
Fix execute proc fn
Browse files Browse the repository at this point in the history
  • Loading branch information
lnauta committed Sep 4, 2024
1 parent 9237687 commit ebf1e8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions picas/executers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def execute(args, shell=False):
@param args: the arguments as they need to be specified for Popen.
@return: a tuple containing the exitcode, stdout & stderr
"""
proc = Popen(args, stdout=PIPE, stderr=PIPE, shell=shell)
(stdout, stderr) = proc.communicate()
return (proc, proc.returncode, stdout, stderr)
with Popen(args, stdout=PIPE, stderr=PIPE, shell=shell) as proc:
(stdout, stderr) = proc.communicate()
return (proc.returncode, stdout, stderr)



Expand Down

0 comments on commit ebf1e8f

Please sign in to comment.