From cecfe37770c3e043f653574feacbe8a3ecda2e12 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Thu, 3 Mar 2022 21:30:46 +0100 Subject: [PATCH] core/config: Fix ConfigError missing argument if toml is missing Fixes the following error: Traceback (most recent call last): File "bin/bandit", line 8, in sys.exit(main()) File "lib/python3.10/site-packages/bandit/cli/main.py", line 455, in main b_conf = b_config.BanditConfig(config_file=args.config_file) File "lib/python3.10/site-packages/bandit/core/config.py", line 45, in __init__ raise utils.ConfigError( TypeError: ConfigError.__init__() missing 1 required positional argument: 'config_file' --- bandit/core/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bandit/core/config.py b/bandit/core/config.py index cdbc8069d..7c259bcc0 100644 --- a/bandit/core/config.py +++ b/bandit/core/config.py @@ -43,7 +43,8 @@ def __init__(self, config_file=None): if config_file.endswith(".toml"): if toml is None: raise utils.ConfigError( - "toml parser not available, reinstall with toml extra" + "toml parser not available, reinstall with toml extra", + config_file, ) try: