Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion bandit/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

import yaml

try:
import toml
except ImportError:
toml = None

from bandit.core import constants
from bandit.core import extension_loader
from bandit.core import utils
Expand Down Expand Up @@ -36,7 +41,10 @@ def __init__(self, config_file=None):
)

if config_file.endswith(".toml"):
import toml
if toml is None:
raise utils.ConfigError(
"toml parser not available, reinstall with toml extra"
)

try:
with f:
Expand Down