Skip to content

Commit

Permalink
core/config: Fix ConfigError missing argument if toml is missing (#845)
Browse files Browse the repository at this point in the history
Fixes the following error:

    Traceback (most recent call last):
      File "bin/bandit", line 8, in <module>
        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'
  • Loading branch information
Holzhaus committed Mar 4, 2022
1 parent fcde9b5 commit 71bc67c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bandit/core/config.py
Expand Up @@ -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:
Expand Down

0 comments on commit 71bc67c

Please sign in to comment.