python/buildtools/pkgconfig.py
def _compare_versions(v1, v2):
    """
    Compare two version strings and return -1, 0 or 1 depending on the equality
    of the subset of matching version numbers.

    The implementation is taken from the top answer at
    http://stackoverflow.com/a/1714190/997768.
    """
    def normalize(v):
        return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]

    n1 = normalize(v1)
    n2 = normalize(v2)

    return (n1 > n2) - (n1 < n2)

    Compare two version strings and return -1, 0 or 1 depending on the equality
    of the subset of matching version numbers.

    The implementation is taken from the top answer at
    http://stackoverflow.com/a/1714190/997768.
    
Compare two version strings and return -1, 0 or 1 depending on the equality
of the subset of matching version numbers.


Compare two version strings and return - 1 0 or 1 depending on the equality of the subset of matching version numbers .
def _compare_versions(v1, v2):
    def normalize(v):
        return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
    n1 = normalize(v1)
    n2 = normalize(v2)
    return (n1 > n2) - (n1 < n2)
def _compare_versions ( v1 , v2 ) : def normalize ( v ) : return [ int ( x ) for x in re . sub ( r'(\.0+)*$' , '' , v ) . split ( "." ) ] n1 = normalize ( v1 ) n2 = normalize ( v2 ) return ( n1 > n2 ) - ( n1 < n2 )
Compare two version strings and return -1, 0 or 1 depending on the equality
of the subset of matching version numbers.
Compare two version strings and return - 1 0 or 1 depending on the equality of the subset of matching version numbers .
"""
    Compare two version strings and return -1, 0 or 1 depending on the equality
    of the subset of matching version numbers.

    The implementation is taken from the top answer at
    http://stackoverflow.com/a/1714190/997768.
    """
v1
v2