From: Naoki Kambe Date: Fri, 14 Oct 2011 11:51:50 +0000 (+0900) Subject: [1275] restore the finally statement in run function in the MockMsgq class. X-Git-Tag: perftcpdns_before_epoll~81^2^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b024ff407a6987a4c7e55f51b9d08c1c9a185d3;p=thirdparty%2Fkea.git [1275] restore the finally statement in run function in the MockMsgq class. As a result of considering any other situation where self.msgq.run() in the try statement is accidentally failed. This changes don't affect the result of the unittest. --- diff --git a/src/bin/stats/tests/test_utils.py b/src/bin/stats/tests/test_utils.py index b3f40f7bb3..5eb8f92c8c 100644 --- a/src/bin/stats/tests/test_utils.py +++ b/src/bin/stats/tests/test_utils.py @@ -101,6 +101,11 @@ class MockMsgq: self.msgq.run() except Exception: pass + finally: + # explicitly shut down the socket of the msgq before + # shutting down the msgq + self.msgq.listen_socket.shutdown(msgq.socket.SHUT_RDWR) + self.msgq.shutdown() def shutdown(self): # do nothing