Skip to content

Commit 86ea581

Browse files
bpo-36737: Use the module state C-API for warnings. (gh-13159)
1 parent 351c674 commit 86ea581

File tree

6 files changed

+208
-122
lines changed

6 files changed

+208
-122
lines changed

Include/internal/pycore_pylifecycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern void PyLong_Fini(void);
8181
extern void _PyFaulthandler_Fini(void);
8282
extern void _PyHash_Fini(void);
8383
extern int _PyTraceMalloc_Fini(void);
84-
extern void _PyWarnings_Fini(_PyRuntimeState *runtime);
84+
extern void _PyWarnings_Fini(PyInterpreterState *interp);
8585

8686
extern void _PyGILState_Init(
8787
_PyRuntimeState *runtime,

Include/internal/pycore_pystate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ struct _is {
9090
PyObject *pyexitmodule;
9191

9292
uint64_t tstate_next_unique_id;
93+
94+
struct _warnings_runtime_state warnings;
9395
};
9496

9597
PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T);
@@ -179,7 +181,6 @@ typedef struct pyruntimestate {
179181
int nexitfuncs;
180182

181183
struct _gc_runtime_state gc;
182-
struct _warnings_runtime_state warnings;
183184
struct _ceval_runtime_state ceval;
184185
struct _gilstate_runtime_state gilstate;
185186

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Move PyRuntimeState.warnings into per-interpreter state (via "module
2+
state").

0 commit comments

Comments
 (0)