From 8f478b3bc9d1f693296da088445ff0b5e3e4ab3b Mon Sep 17 00:00:00 2001 From: Esa Jokinen Date: Wed, 31 Jul 2024 08:16:39 +0300 Subject: [PATCH] follow-cvelist.py backwards compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 7c86751, PEP 634 – Structural Pattern Matching has been used; a feature added in Python 3.10. Replaced with a Python 3.8 compatible alternative. --- bin/follow-cvelist.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/bin/follow-cvelist.py b/bin/follow-cvelist.py index ffe8578..90fa1bd 100755 --- a/bin/follow-cvelist.py +++ b/bin/follow-cvelist.py @@ -584,16 +584,14 @@ def check_positive(value: str) -> int: default=30, ) args = argParser.parse_args() - match args.verbose: - case 4: - print( - "VERBOSITY: raw json, raw changes, git pulls, commit IDs", - file=sys.stderr, - ) - case 3: - print("VERBOSITY: raw changes, git pulls, commit IDs", file=sys.stderr) - case 2: - print("VERBOSITY: git pulls, commit IDs", file=sys.stderr) - case 1: - print("VERBOSITY: commit IDs", file=sys.stderr) + if args.verbose > 4: + args.verbose = 4 + verbosity = { + 4: "raw json, raw changes, git pulls, commit ID", + 3: "raw changes, git pulls, commit IDs", + 2: "git pulls, commit IDs", + 1: "commit IDs", + } + if args.verbose > 0: + print(f"VERBOSITY: {verbosity[args.verbose]}", file=sys.stderr) main(args)