mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-135427: Fix DeprecationWarning for os.fork when run in threads with -Werror (GH-136796)
Don't ignore errors raised by `PyErr_WarnFormat` in `warn_about_fork_with_threads` Instead, ignore the warnings in all test code that forks. (That's a lot of functions.) In `test_support`, make `ignore_warnings` a context manager (as well as decorator), and add a `message` argument to it. Also add a `ignore_fork_in_thread_deprecation_warnings` helper for the deadlock-in-fork warning.
This commit is contained in:
parent
f60f8225ed
commit
fd8f42d3d1
27 changed files with 390 additions and 69 deletions
|
|
@ -8,7 +8,7 @@
|
|||
from test.support.script_helper import (assert_python_ok, assert_python_failure,
|
||||
interpreter_requires_environment)
|
||||
from test import support
|
||||
from test.support import force_not_colorized
|
||||
from test.support import force_not_colorized, warnings_helper
|
||||
from test.support import os_helper
|
||||
from test.support import threading_helper
|
||||
|
||||
|
|
@ -354,6 +354,7 @@ def fork_child(self):
|
|||
# everything is fine
|
||||
return 0
|
||||
|
||||
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
|
||||
@support.requires_fork()
|
||||
def test_fork(self):
|
||||
# check that tracemalloc is still working after fork
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue