diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-25 08:29:50 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-25 08:29:50 (GMT) |
commit | a6d865c128dd46a067358e94c29ca2d84205ae89 (patch) | |
tree | 5ab1f1d1a8c37f022fa3ca6a4041fdccd3b96200 /Lib/multiprocessing/process.py | |
parent | 47b4557679154a645780b2e44dd7a4a2c62b5d12 (diff) | |
download | cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.zip cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.tar.gz cpython-a6d865c128dd46a067358e94c29ca2d84205ae89.tar.bz2 |
Issue #25654:
* multiprocessing: open file with closefd=False to avoid ResourceWarning
* _test_multiprocessing: open file with O_EXCL to detect bugs in tests (if a
previous test forgot to remove TESTFN)
* test_sys_exit(): remove TESTFN after each loop iteration
Initial patch written by Serhiy Storchaka.
Diffstat (limited to 'Lib/multiprocessing/process.py')
-rw-r--r-- | Lib/multiprocessing/process.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 68959bf..bca8b7a 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -234,12 +234,7 @@ class BaseProcess(object): context._force_start_method(self._start_method) _process_counter = itertools.count(1) _children = set() - if sys.stdin is not None: - try: - sys.stdin.close() - sys.stdin = open(os.devnull) - except (OSError, ValueError): - pass + util._close_stdin() old_process = _current_process _current_process = self try: |