Skip to content

Commit

Permalink
bpo-36737: Use the module state C-API for warnings. (pythongh-13159)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently authored May 10, 2019
1 parent 351c674 commit 86ea581
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 122 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_pylifecycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extern void PyLong_Fini(void);
extern void _PyFaulthandler_Fini(void);
extern void _PyHash_Fini(void);
extern int _PyTraceMalloc_Fini(void);
extern void _PyWarnings_Fini(_PyRuntimeState *runtime);
extern void _PyWarnings_Fini(PyInterpreterState *interp);

extern void _PyGILState_Init(
_PyRuntimeState *runtime,
Expand Down
3 changes: 2 additions & 1 deletion Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ struct _is {
PyObject *pyexitmodule;

uint64_t tstate_next_unique_id;

struct _warnings_runtime_state warnings;
};

PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T);
Expand Down Expand Up @@ -179,7 +181,6 @@ typedef struct pyruntimestate {
int nexitfuncs;

struct _gc_runtime_state gc;
struct _warnings_runtime_state warnings;
struct _ceval_runtime_state ceval;
struct _gilstate_runtime_state gilstate;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Move PyRuntimeState.warnings into per-interpreter state (via "module
state").
Loading

0 comments on commit 86ea581

Please sign in to comment.