Skip to content

Commit 2897142

Browse files
authored
gh-109832: concurrent.futures test_deadlock restores sys.stderr (#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().
1 parent 8ac2085 commit 2897142

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_concurrent_futures/test_deadlock.py

+6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ def test_exit_at_task_unpickle(self):
145145
self._check_crash(BrokenProcessPool, id, ExitAtUnpickle())
146146

147147
def test_error_at_task_unpickle(self):
148+
# gh-109832: Restore stderr overriden by _raise_error_ignore_stderr()
149+
self.addCleanup(setattr, sys, 'stderr', sys.stderr)
150+
148151
# Check problem occurring while unpickling a task on workers
149152
self._check_crash(BrokenProcessPool, id, ErrorAtUnpickle())
150153

@@ -180,6 +183,9 @@ def test_error_during_result_pickle_on_worker(self):
180183
self._check_crash(PicklingError, _return_instance, ErrorAtPickle)
181184

182185
def test_error_during_result_unpickle_in_result_handler(self):
186+
# gh-109832: Restore stderr overriden by _raise_error_ignore_stderr()
187+
self.addCleanup(setattr, sys, 'stderr', sys.stderr)
188+
183189
# Check problem occurring while unpickling a task in
184190
# the result_handler thread
185191
self._check_crash(BrokenProcessPool,

0 commit comments

Comments
 (0)