Commit d701a97 1 parent bbc4f66 commit d701a97 Copy full SHA for d701a97
File tree 2 files changed +12
-8
lines changed
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ What's New in Pylint 2.10.1?
15
15
============================
16
16
Release date: TBA
17
17
18
- ..
19
- Put bug fixes that should not wait for a new minor version here
18
+ * pylint does not crash when PYLINT_HOME does not exist.
20
19
20
+ Closes #4883
21
21
22
22
23
23
What's New in Pylint 2.10.0?
Original file line number Diff line number Diff line change 35
35
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
36
36
37
37
import os
38
+ import pathlib
38
39
import pickle
39
40
import sys
40
41
from datetime import datetime
86
87
file = sys .stderr ,
87
88
)
88
89
# Remove old spam prevention file
89
- for filename in os .listdir (PYLINT_HOME ):
90
- if prefix_spam_prevention in filename :
91
- try :
92
- os .remove (os .path .join (PYLINT_HOME , filename ))
93
- except OSError :
94
- pass
90
+ if os .path .exists (PYLINT_HOME ):
91
+ for filename in os .listdir (PYLINT_HOME ):
92
+ if prefix_spam_prevention in filename :
93
+ try :
94
+ os .remove (os .path .join (PYLINT_HOME , filename ))
95
+ except OSError :
96
+ pass
97
+
95
98
# Create spam prevention file for today
96
99
try :
100
+ pathlib .Path (PYLINT_HOME ).mkdir (parents = True , exist_ok = True )
97
101
with open (spam_prevention_file , "w" , encoding = "utf8" ) as f :
98
102
f .write ("" )
99
103
except Exception : # pylint: disable=broad-except
You can’t perform that action at this time.
0 commit comments