diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-02 15:37:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 15:37:25 (GMT) |
commit | 84f9da9ab52e476224baac8786ab104e80ff77ba (patch) | |
tree | e1214358f51ffaa233efaf38f7e74fb245d9a224 | |
parent | 65c845e065d6ff7abc1abdc9c24bc7612a665161 (diff) | |
download | cpython-84f9da9ab52e476224baac8786ab104e80ff77ba.zip cpython-84f9da9ab52e476224baac8786ab104e80ff77ba.tar.gz cpython-84f9da9ab52e476224baac8786ab104e80ff77ba.tar.bz2 |
[3.12] gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887) (#109892)
gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887)
test_error_at_task_unpickle() and
test_error_during_result_unpickle_in_result_handler() now restore
sys.stderr which is overriden by _raise_error_ignore_stderr().
(cherry picked from commit 2897142d2ec0930a8991af964c798b68fb6dcadd)
Co-authored-by: Victor Stinner <vstinner@python.org>
-rw-r--r-- | Lib/test/test_concurrent_futures/test_deadlock.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_concurrent_futures/test_deadlock.py b/Lib/test/test_concurrent_futures/test_deadlock.py index 2f08bf8..7ede95d 100644 --- a/Lib/test/test_concurrent_futures/test_deadlock.py +++ b/Lib/test/test_concurrent_futures/test_deadlock.py @@ -145,6 +145,9 @@ class ExecutorDeadlockTest: self._check_crash(BrokenProcessPool, id, ExitAtUnpickle()) def test_error_at_task_unpickle(self): + # gh-109832: Restore stderr overriden by _raise_error_ignore_stderr() + self.addCleanup(setattr, sys, 'stderr', sys.stderr) + # Check problem occurring while unpickling a task on workers self._check_crash(BrokenProcessPool, id, ErrorAtUnpickle()) @@ -180,6 +183,9 @@ class ExecutorDeadlockTest: self._check_crash(PicklingError, _return_instance, ErrorAtPickle) def test_error_during_result_unpickle_in_result_handler(self): + # gh-109832: Restore stderr overriden by _raise_error_ignore_stderr() + self.addCleanup(setattr, sys, 'stderr', sys.stderr) + # Check problem occurring while unpickling a task in # the result_handler thread self._check_crash(BrokenProcessPool, |