0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Merge bitcoin/bitcoin#26212: contrib: Fix capture_output in getcoins.py

be59bd17ec contrib: Fix capture_output in getcoins.py (willcl-ark)

Pull request description:

  Our minimum 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 both stdout and stderr to `subprocess.PIPE`

Top commit has no ACKs.

Tree-SHA512: 3158bfe657e2d5b263c9337a7ac1dd830e7e119854ec54a40a9e511329fe5bed073350bf70c66b5a6cc9a27dc8eb0e062bbac3969640fd7d6475379726003c98
This commit is contained in:
MacroFake 2022-10-02 16:49:55 +02:00
commit abf20902d0
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -129,7 +129,7 @@ if args.captcha != '': # Retrieve a captcha
# 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.")