summaryrefslogtreecommitdiff
path: root/config.py
diff options
context:
space:
mode:
authorDaniel Balparda <balparda@google.com>2013-11-20 15:01:02 -0800
committerDaniel Balparda <balparda@google.com>2013-11-20 15:01:02 -0800
commit5c4bbbdadc912c23e310c13c972fe7d31485e3e3 (patch)
tree00753de5e6682cdcd6844fe0af2e0a3ddd9b437c /config.py
parent72c4d3f95b4763a7b61f215b235816ef6cef3b0d (diff)
downloadpylint-git-5c4bbbdadc912c23e310c13c972fe7d31485e3e3.tar.gz
Do not try to create the PYLINTHOME directory on import of pylint.config, since it might fail and lead to spurious warnings. Instead, create it when it is needed.
Diffstat (limited to 'config.py')
-rw-r--r--config.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/config.py b/config.py
index 192f2548e..a65a11624 100644
--- a/config.py
+++ b/config.py
@@ -34,12 +34,6 @@ elif USER_HOME == '~':
else:
PYLINT_HOME = join(USER_HOME, '.pylint.d')
-if not exists(PYLINT_HOME):
- try:
- os.mkdir(PYLINT_HOME)
- except OSError:
- print >> sys.stderr, 'Unable to create directory %s' % PYLINT_HOME
-
def get_pdata_path(base_name, recurs):
"""return the path of the file which should contain old search data for the
given base_name with the given options values
@@ -66,6 +60,11 @@ else:
def save_results(results, base):
"""pickle results"""
+ if not exists(PYLINT_HOME):
+ try:
+ os.mkdir(PYLINT_HOME)
+ except OSError:
+ print >> sys.stderr, 'Unable to create directory %s' % PYLINT_HOME
data_file = get_pdata_path(base, 1)
try:
pickle.dump(results, open(data_file, _PICK_MOD))