def safe_get_version(dist):
    
    """Get the distribution version, and returns an empty string when this
    results in a ValueError. This is necessary to avoid crashes when PKG_INFO
    is missing.
    
    @return: a version string
    
    """
    
    try:
        return dist.version
    except ValueError:
        return ''