Browse Source

[master] Merge remote-tracking branch 'origin/trac2190'

Jelte Jansen 12 years ago
parent
commit
e0ffa11d49
2 changed files with 4 additions and 13 deletions
  1. 2 2
      src/bin/msgq/msgq.py.in
  2. 2 11
      src/bin/stats/tests/test_utils.py

+ 2 - 2
src/bin/msgq/msgq.py.in

@@ -131,9 +131,9 @@ class MsgQ:
     def setup_poller(self):
         """Set up the poll thing.  Internal function."""
         try:
-            self.poller = select.poll()
-        except AttributeError:
             self.kqueue = select.kqueue()
+        except AttributeError:
+            self.poller = select.poll()
 
     def add_kqueue_socket(self, socket, write_filter=False):
         """Add a kquque filter for a socket.  By default the read

+ 2 - 11
src/bin/stats/tests/test_utils.py

@@ -107,19 +107,10 @@ class MockMsgq:
 
     def run(self):
         self._started.set()
-        try:
-            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()
+        self.msgq.run()
 
     def shutdown(self):
-        # do nothing
-        pass
+        self.msgq.shutdown()
 
 class MockCfgmgr:
     def __init__(self):