def ensure_list(value, attr):
    """raise an error if `value` is not a list"""
    from distutils.errors import DistutilsSetupError
    if not isinstance(value, list):
        raise DistutilsSetupError('{} must be a list, got {}'.format(attr,
            value.__class__))
