Skip to content

Commit

Permalink
RF: Replace subprocess.Popen with subprocess.run
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Nov 5, 2023
1 parent a560fdb commit 5618682
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ def git(*args):


def _run_command(*command, **kwargs):
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
stdout, _ = process.communicate()
stdout = stdout.decode('utf-8')
process = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs)
stdout = process.stdout.decode('utf-8')

if process.returncode: # no cov
raise Exception(stdout)
Expand Down

0 comments on commit 5618682

Please sign in to comment.