diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 23fd57afaa..1f4ca17321 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3038,11 +3038,18 @@ END #endif""" def CreatePandaVersionFiles(): - version1=int(VERSION.split(".")[0]) - version2=int(VERSION.split(".")[1]) - version3=int(VERSION.split(".")[2]) - nversion=version1*1000000+version2*1000+version3 - if (DISTRIBUTOR != "cmu"): + parts = VERSION.split(".", 2) + version1 = int(parts[0]) + version2 = int(parts[1]) + version3 = 0 + if len(parts) > 2: + for c in parts[2]: + if c.isdigit(): + version3 = version3 * 10 + ord(c) - 48 + else: + break + nversion = version1 * 1000000 + version2 * 1000 + version3 + if DISTRIBUTOR != "cmu": # Subtract 1 if we are not an official version. nversion -= 1