(self)
| 1688 | @unittest.skipUnless(hasattr(os, 'getppid'), |
| 1689 | "Requires os.getppid") |
| 1690 | def test_communicate_eintr(self): |
| 1691 | # Issue #12493: communicate() should handle EINTR |
| 1692 | def handler(signum, frame): |
| 1693 | pass |
| 1694 | old_handler = signal.signal(signal.SIGUSR1, handler) |
| 1695 | self.addCleanup(signal.signal, signal.SIGUSR1, old_handler) |
| 1696 | |
| 1697 | args = [sys.executable, "-c", |
| 1698 | 'import os, signal;' |
| 1699 | 'os.kill(os.getppid(), signal.SIGUSR1)'] |
| 1700 | for stream in ('stdout', 'stderr'): |
| 1701 | kw = {stream: subprocess.PIPE} |
| 1702 | with subprocess.Popen(args, **kw) as process: |
| 1703 | # communicate() will be interrupted by SIGUSR1 |
| 1704 | process.communicate() |
| 1705 | |
| 1706 | |
| 1707 | # This test is Linux-ish specific for simplicity to at least have |
nothing calls this directly
no test coverage detected