mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
For some reason sys.stdin may be None on Windows, and makes test_multiprocessing fail.
Since we are closing the fileno anyway, the best is to skip this part. Now test_multiprocessing should pass on Windows.
This commit is contained in:
parent
d757e73f66
commit
768008c6e2
1 changed files with 5 additions and 4 deletions
|
@ -219,10 +219,11 @@ class Process(object):
|
|||
try:
|
||||
self._children = set()
|
||||
self._counter = itertools.count(1)
|
||||
try:
|
||||
os.close(sys.stdin.fileno())
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
if sys.stdin is not None:
|
||||
try:
|
||||
os.close(sys.stdin.fileno())
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
_current_process = self
|
||||
util._finalizer_registry.clear()
|
||||
util._run_after_forkers()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue