mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
makepanda: Make version parsing in CreatePandaVersionFiles more robust
This commit is contained in:
parent
27daecf030
commit
dcc96a60b1
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user