[svn r37948] fix for win32

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-05 01:36:00 +01:00
parent bdf3e919c9
commit 99661844dd
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,9 @@ class HostInfo(object):
import os import os
targetdir = %r targetdir = %r
if not os.path.isabs(targetdir): if not os.path.isabs(targetdir):
homedir = os.environ['HOME'] homedir = os.environ.get('HOME', '')
if not homedir:
homedir = os.environ.get('HOMEPATH', '.')
targetdir = os.path.join(homedir, targetdir) targetdir = os.path.join(homedir, targetdir)
if not os.path.exists(targetdir): if not os.path.exists(targetdir):
os.makedirs(targetdir) os.makedirs(targetdir)

View File

@ -43,7 +43,7 @@ class TestHostInfo:
x.initgateway() x.initgateway()
assert x.gw assert x.gw
try: try:
homedir = py.path.local(py.std.os.environ['HOME']) homedir = py.path.local._gethomedir()
expected = homedir.join(name) expected = homedir.join(name)
assert x.gw_remotepath == str(expected) assert x.gw_remotepath == str(expected)
assert x.localdest == expected assert x.localdest == expected