'Broken pipe error should not prevent wait() (Issue 21619)'

def test_broken_pipe_cleanup(self):

    proc = subprocess.Popen([sys.executable, '-c', 'pass'], stdin=subprocess.PIPE, bufsize=(support.PIPE_MAX_SIZE * 2))
    proc = proc.__enter__()
    proc.stdin.write(('x' * support.PIPE_MAX_SIZE))
    self.assertIsNone(proc.returncode)
    self.assertRaises(OSError, proc.__exit__, None, None, None)
    self.assertEqual(proc.returncode, 0)
    self.assertTrue(proc.stdin.closed)
