From 3fa440ea9198b1d1549ab8caf9f263d2f06c608f Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 3 Dec 1997 22:34:03 +0000 Subject: [PATCH] Refinement of home for NT, courtesy Jeff Bauer. --- Lib/user.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Lib/user.py b/Lib/user.py index 06287871724..125a7a267e8 100644 --- a/Lib/user.py +++ b/Lib/user.py @@ -23,10 +23,15 @@ import os -try: +home = os.curdir # Default +if os.environ.has_key('HOME'): home = os.environ['HOME'] -except: - home = os.curdir +elif os.name == 'nt': # Contributed by Jeff Bauer + if os.environ.has_key('HOMEPATH'): + if os.environ.has_key('HOMEDRIVE'): + home = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH'] + else: + home = os.environ['HOMEPATH'] pythonrc = os.path.join(home, ".pythonrc.py") try: