This is an automated email from the ASF dual-hosted git repository.

chug pushed a commit to branch dev-protocol-adaptors-2
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/dev-protocol-adaptors-2 by 
this push:
     new ca1c17f  DISPATCH-1820: Fix python tox errors
ca1c17f is described below

commit ca1c17f8a4aebe568e285f4135f94f20d3f047bb
Author: Chuck Rolke <c...@apache.org>
AuthorDate: Tue Nov 3 15:32:32 2020 -0500

    DISPATCH-1820: Fix python tox errors
---
 tests/TCP_echo_server.py          | 6 ++----
 tests/system_tests_tcp_adaptor.py | 5 ++---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/tests/TCP_echo_server.py b/tests/TCP_echo_server.py
index d8a23d4..e74c780 100755
--- a/tests/TCP_echo_server.py
+++ b/tests/TCP_echo_server.py
@@ -132,9 +132,7 @@ class TcpEchoServer():
             except Exception as exc:
                 self.error = ('%s Opening listen socket %s:%d exception: %s' %
                            (self.prefix, self.HOST, self.port, 
traceback.format_exc()))
-                logger.log(self.error)
-                sel.unregister(sock)
-                sock.close()
+                self.logger.log(self.error)
                 return 1
 
             # set up selector
@@ -190,7 +188,7 @@ class TcpEchoServer():
         if mask & selectors.EVENT_READ:
             try:
                 recv_data = sock.recv(1024)
-            except ConnectionResetError as exc:
+            except Exception as exc:
                 logger.log('%s Connection to %s:%d closed by peer' %
                            (self.prefix, data.addr[0], data.addr[1]))
                 sel.unregister(sock)
diff --git a/tests/system_tests_tcp_adaptor.py 
b/tests/system_tests_tcp_adaptor.py
index e290cec..c2b1dd1 100644
--- a/tests/system_tests_tcp_adaptor.py
+++ b/tests/system_tests_tcp_adaptor.py
@@ -39,7 +39,6 @@ from subprocess import PIPE, STDOUT
 from TCP_echo_client import TcpEchoClient
 from TCP_echo_server import TcpEchoServer
 
-
 class TcpAdaptorOneRouterEcho(TestCase, Process):
     """
     Run echo tests through a stand-alone router
@@ -173,10 +172,10 @@ class TcpAdaptorOneRouterEcho(TestCase, Process):
             for count in [1, 10]:
                 # make sure server is still running
                 if server.error is not None:
-                    logger.log("%s Server stopped with error: %s" % (name, 
server.error))
+                    self.logger.log("%s Server stopped with error: %s" % 
(self.name, server.error))
                     result = False
                 if server.exit_status is not None:
-                    logger.log("%s Server stopped with status: %s" % (name, 
server.exit_status))
+                    self.logger.log("%s Server stopped with status: %s" % 
(self.name, server.exit_status))
                     result = False
                 # run another test client
                 if result:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to