Skip to content

Commit

Permalink
core/config: Fix ConfigError missing argument if toml is missing
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 3, 2022
1 parent fcde9b5 commit cecfe37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bandit/core/config.py
Original file line number Diff line number Diff line change
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 cecfe37

Please sign in to comment.