summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2008-05-05 08:52:09 +0200
committerSylvain Thénault <sylvain.thenault@logilab.fr>2008-05-05 08:52:09 +0200
commit1305a73de53853a35a8b27e0b8a37d316bceeef3 (patch)
tree6049717408026e6e708953f88e9717a9ce9685f5
parent2236bb1177d0200105170d5190fd5c3e14e0b501 (diff)
downloadpylint-git-1305a73de53853a35a8b27e0b8a37d316bceeef3.tar.gz
fix USER_HOME name error when PYLINTHOME env var is defined
-rw-r--r--config.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/config.py b/config.py
index 02f86b762..418785db2 100644
--- a/config.py
+++ b/config.py
@@ -21,18 +21,19 @@
import pickle
import os
import sys
-from os.path import exists, isfile, join, expanduser, abspath
+from os.path import exists, isfile, join, expanduser, abspath, dirname
# pylint home is used to save old runs results ################################
+USER_HOME = expanduser('~')
if os.environ.has_key('PYLINTHOME'):
PYLINT_HOME = os.environ['PYLINTHOME']
+ if USER_HOME === '~':
+ USER_HOME = dirname(PYLINT_HOME)
+elif USER_HOME == '~':
+ PYLINT_HOME = ".pylint.d"
else:
- USER_HOME = expanduser('~')
- if USER_HOME == '~':
- PYLINT_HOME = ".pylint.d"
- else:
- PYLINT_HOME = join(USER_HOME, '.pylint.d')
+ PYLINT_HOME = join(USER_HOME, '.pylint.d')
if not exists(PYLINT_HOME):
try: