diff options
-rw-r--r-- | Lib/user.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/user.py b/Lib/user.py index 0628787..125a7a2 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: |