Beispiel #1
0
 def testBrokenPipe(self):
     p = CPopen(["sleep", "1"])
     try:
         p.send_signal(signal.SIGPIPE)
     finally:
         p.kill()
     p.wait()
     self.assertEqual(p.returncode, -signal.SIGKILL)
Beispiel #2
0
 def testBrokenPipeSIGPIPERestored(self):
     if not cpopen.SUPPORTS_RESTORE_SIGPIPE:
         raise SkipTest("subprocess module does not support restore_sigpipe")
     p = CPopen(["sleep", "1"], restore_sigpipe=True)
     try:
         p.send_signal(signal.SIGPIPE)
     finally:
         p.kill()
     p.wait()
     self.assertEqual(p.returncode, -signal.SIGPIPE)