diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index e21d2f077b9..4a06a45d982 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()