[Python-modules-team] Bug#748903: python-tornado: FTBFS on hurd-i386

Samuel Thibault sthibault at debian.org
Fri May 23 11:58:39 UTC 2014


Svante Signell, le Fri 23 May 2014 13:45:50 +0200, a écrit :
> Index: python-tornado-3.2.0/tornado/iostream.py
> ===================================================================
> --- python-tornado-3.2.0.orig/tornado/iostream.py
> +++ python-tornado-3.2.0/tornado/iostream.py
> @@ -748,7 +748,11 @@ class IOStream(BaseIOStream):
>          self._add_io_state(self.io_loop.WRITE)
>  
>      def _handle_connect(self):
> -        err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
> +        try:
> +            err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
> +        except socket.error as e:
> +            if e.args[0] == errno.ENOPROTOOPT:
> +                err = 0
>          if err != 0:
>              self.error = socket.error(err, os.strerror(err))
>              # IOLoop implementations may vary: some of them return

But if it's another error, err and self.error will not be set. Rather
use:

@@ -748,7 +748,12 @@ class IOStream(BaseIOStream):
         self._add_io_state(self.io_loop.WRITE)
 
     def _handle_connect(self):
-        err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
+        try:
+            err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
+        except socket.error as e:
+            err = e.args[0]
+            if err == errno.ENOPROTOOPT:
+                err = 0
         if err != 0:
             self.error = socket.error(err, os.strerror(err))
             # IOLoop implementations may vary: some of them return

Samuel



More information about the Python-modules-team mailing list