From: Guido van Rossum Date: Wed, 3 Dec 1997 22:34:03 +0000 (+0000) Subject: Refinement of home for NT, courtesy Jeff Bauer. X-Git-Tag: v1.5b2~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fa440ea9198b1d1549ab8caf9f263d2f06c608f;p=python Refinement of home for NT, courtesy Jeff Bauer. --- diff --git a/Lib/user.py b/Lib/user.py index 0628787172..125a7a267e 100644 --- a/Lib/user.py +++ b/Lib/user.py @@ -23,10 +23,15 @@ wishes to do different things depending on the Python version. 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: