summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pylint/config/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/pylint/config/__init__.py b/pylint/config/__init__.py
index 292b31f41..6bdd5a82d 100644
--- a/pylint/config/__init__.py
+++ b/pylint/config/__init__.py
@@ -91,8 +91,15 @@ else:
except OSError:
pass
# Create spam prevention file for today
- with open(spam_prevention_file, "w", encoding="utf8") as f:
- f.write("")
+ try:
+ with open(spam_prevention_file, "w", encoding="utf8") as f:
+ f.write("")
+ except Exception: # pylint: disable=broad-except
+ # Can't write in PYLINT_HOME ?
+ print(
+ "Can't write the file that was supposed to "
+ f"prevent pylint.d deprecation spam in {PYLINT_HOME}."
+ )
def _get_pdata_path(base_name, recurs):