@staticmethod
  def parse(version):
    components = version.split('.', 3)
    if len(components) != 3:
      raise ValueError
    major, minor, patch = components

    def to_i(component):
      try:
        return int(component)
      except (TypeError, __HOLE__):
        raise ValueError('Invalid revision component {} in {} - '
                         'must be an integer'.format(component, version))
    return Semver(to_i(major), to_i(minor), to_i(patch))
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/task/scm_publish_mixin.py/Semver.parse