[Python-modules-team] Bug#748903: python-tornado: FTBFS on hurd-i386
Svante Signell
svante.signell at gmail.com
Fri May 23 12:28:49 UTC 2014
On Fri, 2014-05-23 at 13:58 +0200, Samuel Thibault wrote:
> 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
I thoughts it did exactly the same before, indentation stops at err = 0,
i.e. outside the exception, so other errors are not affected. But I can
do as you wish, just let me know. Otherwise al else statement would be
needed.
More information about the Python-modules-team
mailing list