Browse Source

makepanda: Fix build error when flex is absent

rdb 5 years ago
parent
commit
6690b2d86e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      makepanda/makepanda.py
  2. 1 1
      makepanda/makepandacore.py

+ 1 - 1
makepanda/makepanda.py

@@ -1664,7 +1664,7 @@ def CompileFlex(wobj,wsrc,opts):
     dashi = opts.count("FLEXDASHI")
     dashi = opts.count("FLEXDASHI")
     flex = GetFlex()
     flex = GetFlex()
     want_version = GetValueOption(opts, "FLEXVERSION:")
     want_version = GetValueOption(opts, "FLEXVERSION:")
-    if want_version:
+    if flex and want_version:
         # Is flex at the required version for this file?
         # Is flex at the required version for this file?
         want_version = tuple(map(int, want_version.split('.')))
         want_version = tuple(map(int, want_version.split('.')))
         have_version = GetFlexVersion()
         have_version = GetFlexVersion()

+ 1 - 1
makepanda/makepandacore.py

@@ -556,7 +556,7 @@ def GetFlex():
 def GetFlexVersion():
 def GetFlexVersion():
     flex = GetFlex()
     flex = GetFlex()
     if not flex:
     if not flex:
-        return None
+        return (0, 0, 0)
 
 
     try:
     try:
         handle = subprocess.Popen(["flex", "--version"], executable=flex, stdout=subprocess.PIPE)
         handle = subprocess.Popen(["flex", "--version"], executable=flex, stdout=subprocess.PIPE)