mirror of https://github.com/python/cpython.git
Refinement of home for NT, courtesy Jeff Bauer.
This commit is contained in:
parent
7c4cba8325
commit
3fa440ea91
11
Lib/user.py
11
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:
|
||||
|
|
Loading…
Reference in New Issue