def get_main_version(version=None):
    'Return main version (X.Y[.Z]) from VERSION.'
    version = get_complete_version(version)
    parts = (2 if (version[2] == 0) else 3)
    return '.'.join((str(x) for x in version[:parts]))
Return main version (X.Y[.Z]) from VERSION.
def get_main_version(version=None):
    
    version = get_complete_version(version)
    parts = (2 if (version[2] == 0) else 3)
    return '.'.join((str(x) for x in version[:parts]))