Ejemplo n.º 1
0
 def __next__(self):
     try:
         with common_exception_handling(self.environ, self.sentry):
             return next(self.iterable)
     finally:
         # We auto close here if we reach the end because some WSGI
         # middleware does not really like to close things.  To avoid
         # massive leaks we just close automatically at the end of
         # iteration.
         self.close()
Ejemplo n.º 2
0
 def __next__(self):
     try:
         with common_exception_handling(self.environ, self.sentry):
             return next(self.iterable)
     except StopIteration:
         # We auto close here if we reach the end because some WSGI
         # middleware does not really like to close things.  To avoid
         # massive leaks we just close automatically at the end of
         # iteration.
         self.close()
         raise