Discussion:
[Python-3000-checkins] r65906 - python/branches/py3k/Lib/multiprocessing/process.py
amaury.forgeotdarc
2008-08-20 09:04:46 UTC
Permalink
Author: amaury.forgeotdarc
Date: Wed Aug 20 11:04:46 2008
New Revision: 65906

Log:
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.


Modified:
python/branches/py3k/Lib/multiprocessing/process.py

Modified: python/branches/py3k/Lib/multiprocessing/process.py
==============================================================================
--- python/branches/py3k/Lib/multiprocessing/process.py (original)
+++ python/branches/py3k/Lib/multiprocessing/process.py Wed Aug 20 11:04:46 2008
@@ -219,10 +219,11 @@
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...