mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
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
This commit is contained in:
parent
a7c449b8c0
commit
4d3851727f
2 changed files with 12 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue