diff options
Diffstat (limited to 'pylint/config/find_default_config_files.py')
-rw-r--r-- | pylint/config/find_default_config_files.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pylint/config/find_default_config_files.py b/pylint/config/find_default_config_files.py index 92d333f0f..126ac4a1e 100644 --- a/pylint/config/find_default_config_files.py +++ b/pylint/config/find_default_config_files.py @@ -5,11 +5,17 @@ import configparser import os import toml +from toml.decoder import TomlDecodeError def _toml_has_config(path): with open(path) as toml_handle: - content = toml.load(toml_handle) + try: + content = toml.load(toml_handle) + except TomlDecodeError as error: + print("Failed to load '{}': {}".format(path, str(error))) + return False + try: content["tool"]["pylint"] except KeyError: |