Skip to content

Commit

Permalink
contrib: Fix capture_output in getcoins.py
Browse files Browse the repository at this point in the history
Our required Python version 3.6.12 does not support `capture_output` as
a subprocess.run argument; this was added in python 3.7.

We can emulate it by setting stdout and stderr to subprocess.PIPE

Github-Pull: bitcoin#26212
Rebased-From: be59bd1
  • Loading branch information
willcl-ark authored and fanquake committed Oct 2, 2022
1 parent e4f7fd3 commit 1db89aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/signet/getcoins.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def bitcoin_cli(rpc_command_and_params):

# Convert SVG image to PPM, and load it
try:
rv = subprocess.run([args.imagemagick, 'svg:-', '-depth', '8', 'ppm:-'], input=res.content, check=True, capture_output=True)
rv = subprocess.run([args.imagemagick, 'svg:-', '-depth', '8', 'ppm:-'], input=res.content, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except FileNotFoundError:
raise SystemExit(f"The binary {args.imagemagick} could not be found. Please make sure ImageMagick (or a compatible fork) is installed and that the correct path is specified.")

Expand Down

0 comments on commit 1db89aa

Please sign in to comment.