Rev 5272: Just because windows does it differently. in file:///home/vila/src/bzr/experimental/leaking-tests/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jun 7 14:21:43 BST 2010


At file:///home/vila/src/bzr/experimental/leaking-tests/

------------------------------------------------------------
revno: 5272
revision-id: v.ladeuil+lp at free.fr-20100607132143-iv6psj3i3spiphqd
parent: v.ladeuil+lp at free.fr-20100607125558-5rdbfk21podzot0x
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: propagate-exceptions
timestamp: Mon 2010-06-07 15:21:43 +0200
message:
  Just because windows does it differently.
  
  * bzrlib/tests/test_server.py:
  (TestingTCPServerMixin.shutdown_client_socket): Windows raises
  different exceptions on socket shutdown.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_server.py'
--- a/bzrlib/tests/test_server.py	2010-06-07 12:55:58 +0000
+++ b/bzrlib/tests/test_server.py	2010-06-07 13:21:43 +0000
@@ -397,7 +397,11 @@
             sock.shutdown(socket.SHUT_RDWR)
             sock.close()
         except (socket.error, select.error), e:
-            if e[0] in (errno.EBADF, errno.ENOTCONN):
+            accepted_errnos = [errno.EBADF, errno.ENOTCONN, errno.ECONNRESET]
+            if sys.platform == 'win32':
+                accepted_errnos.extend([errno.WSAEBADF, errno.WSAENOTCONN,
+                                        errno.WSAECONNRESET])
+            if e[0] in accepted_errnos:
                 # Right, the socket is already down
                 pass
             else:



More information about the bazaar-commits mailing list