Rev 4747: Tweak the socket error handling. in file:///home/vila/src/bzr/bugs/392127-thread-leak/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Oct 12 16:57:48 BST 2009


At file:///home/vila/src/bzr/bugs/392127-thread-leak/

------------------------------------------------------------
revno: 4747
revision-id: v.ladeuil+lp at free.fr-20091012155748-8x6s0ck3t6ectsez
parent: v.ladeuil+lp at free.fr-20091012155432-m9235zf21lof91vg
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 392127-thread-leak
timestamp: Mon 2009-10-12 17:57:48 +0200
message:
  Tweak the socket error handling.
  
  * bzrlib/tests/test_http.py:
  (RecordingServer.connect_socket): Propagate review feedback to
  duplicated sites.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py	2009-10-12 11:55:55 +0000
+++ b/bzrlib/tests/test_http.py	2009-10-12 15:57:48 +0000
@@ -255,7 +255,7 @@
             pass
 
     def connect_socket(self):
-        msg = "getaddrinfo returns an empty list"
+        err = socket.error('getaddrinfo returns an empty list')
         for res in socket.getaddrinfo(self.host, self.port):
             af, socktype, proto, canonname, sa = res
             sock = None
@@ -264,10 +264,11 @@
                 sock.connect(sa)
                 return sock
 
-            except socket.error, msg:
+            except socket.error, err:
+                # err is now the most recent error
                 if sock is not None:
                     sock.close()
-        raise socket.error, msg
+        raise err
 
     def tearDown(self):
         try:
@@ -283,8 +284,6 @@
         self._thread.join()
         if 'threads' in tests.selftest_debug_flags:
             print 'Thread  joined: %s' % (self._thread.ident,)
-        del self._thread
-        self.thread = None
 
 
 class TestAuthHeader(tests.TestCase):



More information about the bazaar-commits mailing list