changeset 101:017f53eac8bb

Python 3.2 fixes - e.errno becomes e.args[0]
author Velko Ivanov <vivanov@ivanov-nest.com>
date Tue, 25 Oct 2011 13:09:08 +0300
parents 890c4fae300a
children b742134454a0
files flup/server/ajp_base.py flup/server/fcgi_base.py flup/server/scgi_base.py flup/server/singleserver.py flup/server/threadedserver.py
diffstat 5 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/flup/server/ajp_base.py	Tue Oct 25 12:12:29 2011 +0300
     1.2 +++ b/flup/server/ajp_base.py	Tue Oct 25 13:09:08 2011 +0300
     1.3 @@ -250,7 +250,7 @@
     1.4              try:
     1.5                  data = sock.recv(length)
     1.6              except socket.error as e:
     1.7 -                if e.errno == errno.EAGAIN:
     1.8 +                if e.args[0] == errno.EAGAIN:
     1.9                      select.select([sock], [], [])
    1.10                      continue
    1.11                  else:
    1.12 @@ -297,7 +297,7 @@
    1.13              try:
    1.14                  sent = sock.send(data)
    1.15              except socket.error as e:
    1.16 -                if e.errno == errno.EAGAIN:
    1.17 +                if e.args[0] == errno.EAGAIN:
    1.18                      select.select([], [sock], [])
    1.19                      continue
    1.20                  else:
    1.21 @@ -921,7 +921,7 @@
    1.22                      if hasattr(result, 'close'):
    1.23                          result.close()
    1.24              except socket.error as e:
    1.25 -                if e.errno != errno.EPIPE:
    1.26 +                if e.args[0] != errno.EPIPE:
    1.27                      raise # Don't let EPIPE propagate beyond server
    1.28          finally:
    1.29              if not self.multithreaded:
     2.1 --- a/flup/server/fcgi_base.py	Tue Oct 25 12:12:29 2011 +0300
     2.2 +++ b/flup/server/fcgi_base.py	Tue Oct 25 13:09:08 2011 +0300
     2.3 @@ -451,7 +451,7 @@
     2.4              try:
     2.5                  data = sock.recv(length)
     2.6              except socket.error as e:
     2.7 -                if e.errno == errno.EAGAIN:
     2.8 +                if e.args[0] == errno.EAGAIN:
     2.9                      select.select([sock], [], [])
    2.10                      continue
    2.11                  else:
    2.12 @@ -508,7 +508,7 @@
    2.13              try:
    2.14                  sent = sock.send(data)
    2.15              except socket.error as e:
    2.16 -                if e.errno == errno.EAGAIN:
    2.17 +                if e.args[0] == errno.EAGAIN:
    2.18                      select.select([], [sock], [])
    2.19                      continue
    2.20                  else:
    2.21 @@ -573,7 +573,7 @@
    2.22              self._flush()
    2.23              self._end(appStatus, protocolStatus)
    2.24          except socket.error as e:
    2.25 -            if e.errno != errno.EPIPE:
    2.26 +            if e.args[0] != errno.EPIPE:
    2.27                  raise
    2.28  
    2.29      def _end(self, appStatus=0, protocolStatus=FCGI_REQUEST_COMPLETE):
    2.30 @@ -649,7 +649,7 @@
    2.31              except (EOFError, KeyboardInterrupt):
    2.32                  break
    2.33              except (select.error, socket.error) as e:
    2.34 -                if e.errno == errno.EBADF: # Socket was closed by Request.
    2.35 +                if e.args[0] == errno.EBADF: # Socket was closed by Request.
    2.36                      break
    2.37                  raise
    2.38  
    2.39 @@ -982,10 +982,10 @@
    2.40              try:
    2.41                  sock.getpeername()
    2.42              except socket.error as e:
    2.43 -                if e.errno == errno.ENOTSOCK:
    2.44 +                if e.args[0] == errno.ENOTSOCK:
    2.45                      # Not a socket, assume CGI context.
    2.46                      isFCGI = False
    2.47 -                elif e.errno != errno.ENOTCONN:
    2.48 +                elif e.args[0] != errno.ENOTCONN:
    2.49                      raise
    2.50  
    2.51              # FastCGI/CGI discrimination is broken on Mac OS X.
    2.52 @@ -1141,7 +1141,7 @@
    2.53                      if hasattr(result, 'close'):
    2.54                          result.close()
    2.55              except socket.error as e:
    2.56 -                if e.errno != errno.EPIPE:
    2.57 +                if e.args[0] != errno.EPIPE:
    2.58                      raise # Don't let EPIPE propagate beyond server
    2.59          finally:
    2.60              if not self.multithreaded:
     3.1 --- a/flup/server/scgi_base.py	Tue Oct 25 12:12:29 2011 +0300
     3.2 +++ b/flup/server/scgi_base.py	Tue Oct 25 13:09:08 2011 +0300
     3.3 @@ -77,7 +77,7 @@
     3.4          try:
     3.5              data = sock.recv(length)
     3.6          except socket.error as e:
     3.7 -            if e.errno == errno.EAGAIN:
     3.8 +            if e.args[0] == errno.EAGAIN:
     3.9                  select.select([sock], [], [])
    3.10                  continue
    3.11              else:
    3.12 @@ -100,7 +100,7 @@
    3.13          try:
    3.14              c = sock.recv(1)
    3.15          except socket.error as e:
    3.16 -            if e.errno == errno.EAGAIN:
    3.17 +            if e.args[0] == errno.EAGAIN:
    3.18                  select.select([sock], [], [])
    3.19                  continue
    3.20              else:
    3.21 @@ -477,7 +477,7 @@
    3.22                      if hasattr(result, 'close'):
    3.23                          result.close()
    3.24              except socket.error as e:
    3.25 -                if e.errno != errno.EPIPE:
    3.26 +                if e.args[0] != errno.EPIPE:
    3.27                      raise # Don't let EPIPE propagate beyond server
    3.28          finally:
    3.29              if not self.multithreaded:
     4.1 --- a/flup/server/singleserver.py	Tue Oct 25 12:12:29 2011 +0300
     4.2 +++ b/flup/server/singleserver.py	Tue Oct 25 13:09:08 2011 +0300
     4.3 @@ -71,7 +71,7 @@
     4.4              try:
     4.5                  r, w, e = select.select([sock], [], [], timeout)
     4.6              except select.error as e:
     4.7 -                if e[0] == errno.EINTR:
     4.8 +                if e.args[0] == errno.EINTR:
     4.9                      continue
    4.10                  raise
    4.11  
    4.12 @@ -79,7 +79,7 @@
    4.13                  try:
    4.14                      clientSock, addr = sock.accept()
    4.15                  except socket.error as e:
    4.16 -                    if e[0] in (errno.EINTR, errno.EAGAIN):
    4.17 +                    if e.args[0] in (errno.EINTR, errno.EAGAIN):
    4.18                          continue
    4.19                      raise
    4.20  
     5.1 --- a/flup/server/threadedserver.py	Tue Oct 25 12:12:29 2011 +0300
     5.2 +++ b/flup/server/threadedserver.py	Tue Oct 25 13:09:08 2011 +0300
     5.3 @@ -75,7 +75,7 @@
     5.4              try:
     5.5                  r, w, e = select.select([sock], [], [], timeout)
     5.6              except select.error as e:
     5.7 -                if e[0] == errno.EINTR:
     5.8 +                if e.args[0] == errno.EINTR:
     5.9                      continue
    5.10                  raise
    5.11  
    5.12 @@ -83,7 +83,7 @@
    5.13                  try:
    5.14                      clientSock, addr = sock.accept()
    5.15                  except socket.error as e:
    5.16 -                    if e[0] in (errno.EINTR, errno.EAGAIN):
    5.17 +                    if e.args[0] in (errno.EINTR, errno.EAGAIN):
    5.18                          continue
    5.19                      raise
    5.20