mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
fix for Windows build when "." is not explicitly on the PATH
This commit is contained in:
parent
cdbd54c9be
commit
2c1dcdb7b4
@ -410,11 +410,18 @@ def LocateBinary(binary):
|
|||||||
else:
|
else:
|
||||||
p = os.environ["PATH"]
|
p = os.environ["PATH"]
|
||||||
|
|
||||||
|
pathList = p.split(os.pathsep)
|
||||||
|
|
||||||
|
if GetHost() == 'windows':
|
||||||
|
if not binary.endswith('.exe'):
|
||||||
# Append .exe if necessary
|
# Append .exe if necessary
|
||||||
if GetHost() == 'windows' and not binary.endswith('.exe'):
|
|
||||||
binary += '.exe'
|
binary += '.exe'
|
||||||
|
|
||||||
for path in p.split(os.pathsep):
|
# On Windows the current directory is always implicitly
|
||||||
|
# searched before anything else on PATH.
|
||||||
|
pathList = ['.'] + pathList
|
||||||
|
|
||||||
|
for path in pathList:
|
||||||
binpath = os.path.join(os.path.expanduser(path), binary)
|
binpath = os.path.join(os.path.expanduser(path), binary)
|
||||||
if os.access(binpath, os.X_OK):
|
if os.access(binpath, os.X_OK):
|
||||||
return os.path.abspath(os.path.realpath(binpath))
|
return os.path.abspath(os.path.realpath(binpath))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user