mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
makepanda: Fix detecting flex version on macOS, more robust checking
This commit is contained in:
parent
5d5efb75e8
commit
fd2041d209
@ -558,10 +558,17 @@ def GetFlexVersion():
|
|||||||
if not flex:
|
if not flex:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
handle = subprocess.Popen(["flex", "--version"], executable=flex, stdout=subprocess.PIPE)
|
try:
|
||||||
version = handle.communicate()[0].strip().splitlines()[0].split(b' ')[-1]
|
handle = subprocess.Popen(["flex", "--version"], executable=flex, stdout=subprocess.PIPE)
|
||||||
version = tuple(map(int, version.split(b'.')))
|
words = handle.communicate()[0].strip().splitlines()[0].split(b' ')
|
||||||
return version
|
if words[1] != "version":
|
||||||
|
version = words[1]
|
||||||
|
else:
|
||||||
|
version = words[2]
|
||||||
|
return tuple(map(int, version.split(b'.')))
|
||||||
|
except:
|
||||||
|
Warn("Unable to detect flex version")
|
||||||
|
return (0, 0, 0)
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
##
|
##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user