[svn r64259] porting afa's 64232 and 64253 to trunk

--HG--
branch : trunk
This commit is contained in:
hpk 2009-04-17 13:30:55 +02:00
parent 9ad1efe91d
commit b3e22554d7
2 changed files with 14 additions and 1 deletions

View File

@ -514,6 +514,8 @@ class LocalPath(common.FSPathBase, PlatformMixin):
else:
if iswin32:
paths = py.std.os.environ['Path'].split(';')
if '' not in paths and '.' not in paths:
paths.append('.')
try:
systemroot = os.environ['SYSTEMROOT']
except KeyError:

View File

@ -42,4 +42,15 @@ class TestWINLocalPath:
assert t1 == str(self.root) + '\\a_path'
t1 = self.root.join('dir/a_path')
assert t1 == str(self.root) + '\\dir\\a_path'
def test_sysfind_in_currentdir(self):
cmd = py.path.local.sysfind('cmd')
root = cmd.new(dirname='', basename='') # c:\ in most installations
old = root.chdir()
try:
x = py.path.local.sysfind(cmd.relto(root))
assert x.check(file=1)
finally:
old.chdir()