def _safe_iterator(self, iterator):
        # ensure result cache is cleared when iterating over a queryset
        # raises an exception
        try:
            for item in iterator:
                yield item
        except __HOLE__:
            raise
        except Exception:
            self._result_cache = None
            raise
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/models/query.py/QuerySet._safe_iterator