findVersion1_8 doesn't take modded or prerelease versions

This commit is contained in:
David Vierra 2015-02-06 21:30:35 -10:00
parent a7cf8b5853
commit e17f7af634

View File

@ -95,11 +95,19 @@ class MCInstall(object):
for v in self.versions:
major, minor, rev = splitVersion(v)
if (major, minor) >= (1, 8):
return v
if rev == "":
return v
try:
rev = int(rev) # skip revs like ".2-pre1" and ".1-OptiFine_HD_U_C7", only accept full releases
return v
except ValueError:
pass
def splitVersion(version):
"""
Split a Minecraft version ID into major, minor, and revision. If the version could not be parsed, return (0, 0, "")
The revision is returned with the leading period. For example, if "1.8.1-pre3" is passed, (1, 8, ".1-pre3") will
be returned.
:param version:
:type version: unicode