From facaf5621446d819440f5a873848c01c848c3ecc Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Mon, 12 Jan 2026 09:00:52 +0100 Subject: [PATCH] contrib: Remove unused functions --- contrib/devtools/utils.py | 21 --------------------- contrib/verify-binaries/verify.py | 19 ------------------- 2 files changed, 40 deletions(-) delete mode 100755 contrib/devtools/utils.py diff --git a/contrib/devtools/utils.py b/contrib/devtools/utils.py deleted file mode 100755 index 7f37c607dd2..00000000000 --- a/contrib/devtools/utils.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2021-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -''' -Common utility functions -''' -import shutil -import sys -import os - - -def determine_wellknown_cmd(envvar, progname) -> list[str]: - maybe_env = os.getenv(envvar) - maybe_which = shutil.which(progname) - if maybe_env: - return maybe_env.split(' ') # Well-known vars are often meant to be word-split - elif maybe_which: - return [ maybe_which ] - else: - sys.exit(f"{progname} not found") diff --git a/contrib/verify-binaries/verify.py b/contrib/verify-binaries/verify.py index af891122127..c989e8bdedb 100755 --- a/contrib/verify-binaries/verify.py +++ b/contrib/verify-binaries/verify.py @@ -39,8 +39,6 @@ import sys import shutil import tempfile import textwrap -import urllib.request -import urllib.error import enum from hashlib import sha256 from pathlib import PurePath, Path @@ -116,18 +114,6 @@ def download_with_wget(remote_file, local_file): return result.returncode == 0, result.stdout.decode().rstrip() -def download_lines_with_urllib(url) -> tuple[bool, list[str]]: - """Get (success, text lines of a file) over HTTP.""" - try: - return (True, [ - line.strip().decode() for line in urllib.request.urlopen(url).readlines()]) - except urllib.error.HTTPError as e: - log.warning(f"HTTP request to {url} failed (HTTPError): {e}") - except Exception as e: - log.warning(f"HTTP request to {url} failed ({e})") - return (False, []) - - def verify_with_gpg( filename, signature_filename, @@ -148,11 +134,6 @@ def verify_with_gpg( return result.returncode, gpg_data -def remove_files(filenames): - for filename in filenames: - os.remove(filename) - - class SigData: """GPG signature data as parsed from GPG stdout.""" def __init__(self):