Browse Source

[1828] Add comments about the close() calls

Mukund Sivaraman 13 years ago
parent
commit
c4b20d7ad5
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/bin/msgq/tests/msgq_test.py

+ 8 - 0
src/bin/msgq/tests/msgq_test.py

@@ -155,6 +155,10 @@ class SendNonblock(unittest.TestCase):
                 sender(msgq, write)
         except socket.error:
             pass
+
+        # Explicitly close temporary socket pair as the Python
+        # interpreter expects it.  It may not be 100% exception safe,
+        # but since this is only for tests we prefer brevity.
         read.close()
         write.close()
 
@@ -219,6 +223,10 @@ class SendNonblock(unittest.TestCase):
                 finally:
                     os.kill(queue_pid, signal.SIGTERM)
         self.terminate_check(run)
+
+        # Explicitly close temporary socket pair as the Python
+        # interpreter expects it.  It may not be 100% exception safe,
+        # but since this is only for tests we prefer brevity.
         queue.close()
         out.close()