diff options
Diffstat (limited to 'Tools/idle/IdleConf.py')
-rw-r--r-- | Tools/idle/IdleConf.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tools/idle/IdleConf.py b/Tools/idle/IdleConf.py index de208b0..4d6ca4d 100644 --- a/Tools/idle/IdleConf.py +++ b/Tools/idle/IdleConf.py @@ -100,12 +100,16 @@ def load(dir): genplatfile = os.path.join(dir, "config-unix.txt") platfile = os.path.join(dir, "config-%s.txt" % sys.platform) + + try: + homedir = os.environ['HOME'] + except KeyError: + homedir = os.getcwd() for file in (os.path.join(dir, "config.txt"), genplatfile, platfile, - # XXX watch out for KeyError - os.path.join(os.environ['HOME'], ".idle"), + os.path.join(homedir, ".idle"), ): try: f = open(file) |