 Chromium Code Reviews
 Chromium Code Reviews Issue 6331007:
  Use different proxy ports, and log port conflicts. Hopefully works around  (Closed) 
  Base URL: http://git.chromium.org/git/crosutils.git@master
    
  
    Issue 6331007:
  Use different proxy ports, and log port conflicts. Hopefully works around  (Closed) 
  Base URL: http://git.chromium.org/git/crosutils.git@master| Index: lib/cros_test_proxy.py | 
| diff --git a/lib/cros_test_proxy.py b/lib/cros_test_proxy.py | 
| index 21709829c35c26049b365c35f2d6bbdab21992e9..e505c542b98bacce7f28ecfdebeb587ed0d3c5f2 100755 | 
| --- a/lib/cros_test_proxy.py | 
| +++ b/lib/cros_test_proxy.py | 
| @@ -100,9 +100,14 @@ class CrosTestProxy(SocketServer.ThreadingMixIn, SocketServer.TCPServer): | 
| self.port_out = port_out | 
| self.filter = filter | 
| - SocketServer.TCPServer.__init__(self, | 
| - ('', port_in), | 
| - self._Handler) | 
| + try: | 
| + SocketServer.TCPServer.__init__(self, | 
| + ('', port_in), | 
| + self._Handler) | 
| + except socket.error: | 
| + import os | 
| 
sosa
2011/01/19 20:07:55
please import os at the top
 | 
| + os.system("sudo netstat -l --tcp -n -p") | 
| 
sosa
2011/01/19 20:07:55
use '' rather than "" to be consistent.
 | 
| + raise | 
| def serve_forever_in_thread(self): | 
| """Helper method to start the server in a new background thread.""" |