From e52abb79024b7196fa2c86ea29124d3e2fb4daed Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Feb 18 2026 01:44:53 +0000 Subject: Various code linter issues fixed Claude code suggested some minor improvements; some of them were accepted. Regarding not using '%' operator in the log call - it happens before checking the log level, thus wasting CPU cycles even when debug logging is disabled. Signed-off-by: Ondřej Nosek --- diff --git a/fedpkg/__main__.py b/fedpkg/__main__.py index c100f2b..0bdae35 100644 --- a/fedpkg/__main__.py +++ b/fedpkg/__main__.py @@ -59,7 +59,7 @@ def main(): if not client.args.path: try: client.args.path = pyrpkg.utils.getcwd() - except Exception: + except OSError: print('Could not get current path, have you deleted it?') sys.exit(1) @@ -84,8 +84,7 @@ def main(): except KeyboardInterrupt: pass except Exception as e: - log.error('Could not execute %s: %s' % - (client.args.command.__name__, e)) + log.error('Could not execute %s: %s', client.args.command.__name__, e) if client.args.v: raise sys.exit(1) diff --git a/fedpkg/cli.py b/fedpkg/cli.py index 3536d2e..1cccbb5 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -159,7 +159,7 @@ class fedpkgClient(cliClient): """ Set specific argument completers for fedpkg. Structure, where are these assignments (name -> method) stored, is in the parent - class and have to be filled before __init__ (containing argument + class and has to be filled before __init__ (containing argument parser definitions) is called there. """ cliClient.set_completer("build_arches", build_arches) diff --git a/fedpkg/utils.py b/fedpkg/utils.py index 9ca4985..c8aafe7 100644 --- a/fedpkg/utils.py +++ b/fedpkg/utils.py @@ -605,8 +605,6 @@ def config_get_safely(config, section, option): option, section ) raise rpkgError("{0}\n{1}".format(msg, hint)) - except Exception: - raise def disable_monitoring(logger, base_url, token, repo_name, namespace, cli_name):