]> granicus.if.org Git - python/commitdiff
For some reason sys.stdin may be None on Windows, and makes test_multiprocessing...
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Wed, 20 Aug 2008 09:04:46 +0000 (09:04 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Wed, 20 Aug 2008 09:04:46 +0000 (09:04 +0000)
Since we are closing the fileno anyway, the best is to skip this part.

Now test_multiprocessing should pass on Windows.

Lib/multiprocessing/process.py

index e21d2f077b988e5f0500bd7674e8707a6aa1efeb..4a06a45d982bd3190ed0be1543771e36e91caec6 100644 (file)
@@ -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()