'Remove cache folders to make cache size fit in ``bytes_limit``.'

def reduce_size(self):

    if ((self.cachedir is not None) and (self.bytes_limit is not None)):
        cache_items_to_delete = _get_cache_items_to_delete(self.cachedir, self.bytes_limit)
        for cache_item in cache_items_to_delete:
            if (self._verbose > 10):
                print 'Deleting    cache    item    {}'.format(cache_item)
            try:
                shutil.rmtree(cache_item.path, ignore_errors=True)
            except OSError:
                pass
