diff options
| author | Daniel Balparda <balparda@google.com> | 2013-11-20 15:01:02 -0800 |
|---|---|---|
| committer | Daniel Balparda <balparda@google.com> | 2013-11-20 15:01:02 -0800 |
| commit | 5c4bbbdadc912c23e310c13c972fe7d31485e3e3 (patch) | |
| tree | 00753de5e6682cdcd6844fe0af2e0a3ddd9b437c /config.py | |
| parent | 72c4d3f95b4763a7b61f215b235816ef6cef3b0d (diff) | |
| download | pylint-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.py | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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)) |
