File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 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?
1515============================
1616Release date: TBA
1717
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.
2019
20+ Closes #4883
2121
2222
2323What's New in Pylint 2.10.0?
Original file line number Diff line number Diff line change 3535# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
3636
3737import os
38+ import pathlib
3839import pickle
3940import sys
4041from datetime import datetime
8687 file = sys .stderr ,
8788 )
8889 # 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+
9598 # Create spam prevention file for today
9699 try :
100+ pathlib .Path (PYLINT_HOME ).mkdir (parents = True , exist_ok = True )
97101 with open (spam_prevention_file , "w" , encoding = "utf8" ) as f :
98102 f .write ("" )
99103 except Exception : # pylint: disable=broad-except
You can’t perform that action at this time.
0 commit comments