summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--pylint/config/find_default_config_files.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index cad49c23c..9932c5553 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -455,6 +455,8 @@ contributors:
* Louis Sautier: contributor
+* Quentin Young: contributor
+
* Alexander Kapshuna: contributor
* Mark Byrne: contributor
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: