mirror of
https://github.com/python/cpython.git
synced 2025-10-27 03:34:32 +00:00
Make `warnings.catch_warnings()` use a context variable for holding the warning filtering state if the `sys.flags.context_aware_warnings` flag is set to true. This makes using the context manager thread-safe in multi-threaded programs. Add the `sys.flags.thread_inherit_context` flag. If true, starting a new thread with `threading.Thread` will use a copy of the context from the caller of `Thread.start()`. Both these flags are set to true by default for the free-threaded build and false for the default build. Move the Python implementation of warnings.py into _py_warnings.py. Make _contextvars a builtin module. Co-authored-by: Kumar Aditya <kumaraditya@python.org> |
||
|---|---|---|
| .. | ||
| _contextvars.c.h | ||
| _warnings.c.h | ||
| bltinmodule.c.h | ||
| context.c.h | ||
| import.c.h | ||
| instruction_sequence.c.h | ||
| instrumentation.c.h | ||
| marshal.c.h | ||
| Python-tokenize.c.h | ||
| sysmodule.c.h | ||
| traceback.c.h | ||