From 997faf6b6c774dc87ae730f2f08d7f4f08bdfd04 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Fri, 30 Sep 2022 13:12:32 +0100 Subject: [PATCH] contrib: Fix capture_output in getcoins.py 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: #26212 Rebased-From: be59bd17ec753af7cc763474f2432d12bfc88c2f --- contrib/signet/getcoins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/signet/getcoins.py b/contrib/signet/getcoins.py index 147d12600df..a069f5fad3d 100755 --- a/contrib/signet/getcoins.py +++ b/contrib/signet/getcoins.py @@ -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.")