From: Amaury Forgeot d'Arc Date: Wed, 20 Aug 2008 09:04:46 +0000 (+0000) Subject: For some reason sys.stdin may be None on Windows, and makes test_multiprocessing... X-Git-Tag: v3.0b3~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=768008c6e2939d6bb6d275ba4f146e67bf7a6ab7;p=python 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. --- diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index e21d2f077b..4a06a45d98 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -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()