From a1ef32b5e030a67c2c011137e23b75609a4181e7 Mon Sep 17 00:00:00 2001 From: why-not-try-calmer Date: Thu, 21 Dec 2023 12:07:01 +0100 Subject: [PATCH] Fix incorrect subparser, missing exception guards --- qgispluginci/cli.py | 10 +++++----- qgispluginci/parameters.py | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/qgispluginci/cli.py b/qgispluginci/cli.py index c115239f..26c0b423 100755 --- a/qgispluginci/cli.py +++ b/qgispluginci/cli.py @@ -71,6 +71,11 @@ def cli(): action="append", help="An additional asset path to add. Can be specified multiple times.", ) + package_parser.add_argument( + "--no-validation", + action="store_true", + help="Turn off validation of `release version`", + ) # changelog changelog_parser = subparsers.add_parser( @@ -88,11 +93,6 @@ def cli(): release_parser.add_argument( "release_version", help="The version to be released (x.y.z)." ) - release_parser.add_argument( - "--no-validation", - action="store_true", - help="Turn off validation of `release version`", - ) release_parser.add_argument( "--release-tag", help="The release tag, if different from the version (e.g. vx.y.z).", diff --git a/qgispluginci/parameters.py b/qgispluginci/parameters.py index a1b2c9e4..0ac68abf 100644 --- a/qgispluginci/parameters.py +++ b/qgispluginci/parameters.py @@ -146,7 +146,11 @@ def explore_config() -> Dict[str, Any]: if path_to_file.is_file(): try: return load_config(path_to_file, path_to_file.name) - except ConfigurationNotFound: + except ( + ConfigurationNotFound, + configparser.NoSectionError, + KeyError, + ): pass raise configuration_not_found