summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-20 09:04:46 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-08-20 09:04:46 (GMT)
commit768008c6e2939d6bb6d275ba4f146e67bf7a6ab7 (patch)
tree57a3525857043dda72f8d4b96e1f72ae98f634a8 /Lib/multiprocessing
parentd757e73f660fcd930ad7602ab7c65de0a926c955 (diff)
downloadcpython-768008c6e2939d6bb6d275ba4f146e67bf7a6ab7.zip
cpython-768008c6e2939d6bb6d275ba4f146e67bf7a6ab7.tar.gz
cpython-768008c6e2939d6bb6d275ba4f146e67bf7a6ab7.tar.bz2
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.
Diffstat (limited to 'Lib/multiprocessing')
-rw-r--r--Lib/multiprocessing/process.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py
index e21d2f0..4a06a45 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()