mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Refinement of home for NT, courtesy Jeff Bauer.
This commit is contained in:
parent
7c4cba8325
commit
3fa440ea91
1 changed files with 8 additions and 3 deletions
11
Lib/user.py
11
Lib/user.py
|
@ -23,10 +23,15 @@ wishes to do different things depending on the Python version.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
home = os.curdir # Default
|
||||||
|
if os.environ.has_key('HOME'):
|
||||||
home = os.environ['HOME']
|
home = os.environ['HOME']
|
||||||
except:
|
elif os.name == 'nt': # Contributed by Jeff Bauer
|
||||||
home = os.curdir
|
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")
|
pythonrc = os.path.join(home, ".pythonrc.py")
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue