diff --git a/tornado/iostream.py b/tornado/iostream.py index 53e81fff3..89814c0b6 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -346,7 +346,7 @@ def read_until_regex( gen_log.info("Unsatisfiable read, closing connection: %s" % e) self.close(exc_info=e) return future - except: + except Exception: # Ensure that the future doesn't log an error because its # failure was never examined. future.add_done_callback(lambda f: f.exception()) @@ -383,7 +383,7 @@ def read_until( gen_log.info("Unsatisfiable read, closing connection: %s" % e) self.close(exc_info=e) return future - except: + except Exception: future.add_done_callback(lambda f: f.exception()) raise return future @@ -411,7 +411,7 @@ def read_bytes(self, num_bytes: int, partial: bool = False) -> Awaitable[bytes]: self._read_partial = partial try: self._try_inline_read() - except: + except Exception: future.add_done_callback(lambda f: f.exception()) raise return future @@ -456,7 +456,7 @@ def read_into(self, buf: bytearray, partial: bool = False) -> Awaitable[int]: try: self._try_inline_read() - except: + except Exception: future.add_done_callback(lambda f: f.exception()) raise return future @@ -486,7 +486,7 @@ def read_until_close(self) -> Awaitable[bytes]: self._read_until_close = True try: self._try_inline_read() - except: + except Exception: future.add_done_callback(lambda f: f.exception()) raise return future