diff options
author | Segev Finer <segev208@gmail.com> | 2017-08-18 13:18:13 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-08-18 13:18:13 (GMT) |
commit | 4d3851727fb82195e4995c6064b0b2d6cbc031c4 (patch) | |
tree | d39c125eded8ac59a4108465ff9fbea47c730628 /Lib/test/test_subprocess.py | |
parent | a7c449b8c08933deabcf329fb74ed1336f6db34f (diff) | |
download | cpython-4d3851727fb82195e4995c6064b0b2d6cbc031c4.zip cpython-4d3851727fb82195e4995c6064b0b2d6cbc031c4.tar.gz cpython-4d3851727fb82195e4995c6064b0b2d6cbc031c4.tar.bz2 |
bpo-30121: Fix debug assert in subprocess on Windows (#1224)
* bpo-30121: Fix debug assert in subprocess on Windows
This is caused by closing HANDLEs using os.close which is for CRT file
descriptors and not for HANDLEs.
* bpo-30121: Suppress debug assertion in test_subprocess when ran directly
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 1d2d15c..8cda1e8 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1116,10 +1116,11 @@ class ProcessTestCase(BaseTestCase): p.stdin.write(line) # expect that it flushes the line in text mode os.close(p.stdin.fileno()) # close it without flushing the buffer read_line = p.stdout.readline() - try: - p.stdin.close() - except OSError: - pass + with support.SuppressCrashReport(): + try: + p.stdin.close() + except OSError: + pass p.stdin = None self.assertEqual(p.returncode, 0) self.assertEqual(read_line, expected) |