]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Silence a warning on freebsd.
authorBen Darnell <ben@bendarnell.com>
Sun, 1 Feb 2015 15:52:30 +0000 (10:52 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 1 Feb 2015 15:52:30 +0000 (10:52 -0500)
This was already changed for other platforms but the error behaves
a bit differently on freebsd.

tornado/iostream.py

index 640198d87c9d7e13dfd73d8ba0b10a80d86d5fc7..cdb6250b9055fed5bb86fab08f3eb87b82b00cf1 100644 (file)
@@ -1039,8 +1039,9 @@ class IOStream(BaseIOStream):
             # reported later in _handle_connect.
             if (errno_from_exception(e) not in _ERRNO_INPROGRESS and
                     errno_from_exception(e) not in _ERRNO_WOULDBLOCK):
-                gen_log.warning("Connect error on fd %s: %s",
-                                self.socket.fileno(), e)
+                if future is None:
+                    gen_log.warning("Connect error on fd %s: %s",
+                                    self.socket.fileno(), e)
                 self.close(exc_info=True)
                 return future
         self._add_io_state(self.io_loop.WRITE)