Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
86ea5814
Commit
86ea5814
authored
May 10, 2019
by
Eric Snow
Committed by
GitHub
May 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36737: Use the module state C-API for warnings. (gh-13159)
parent
351c6741
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
208 additions
and
122 deletions
+208
-122
Include/internal/pycore_pylifecycle.h
Include/internal/pycore_pylifecycle.h
+1
-1
Include/internal/pycore_pystate.h
Include/internal/pycore_pystate.h
+2
-1
Misc/NEWS.d/next/Core and Builtins/2019-05-07-12-18-11.bpo-36737.XAo6LY.rst
...ore and Builtins/2019-05-07-12-18-11.bpo-36737.XAo6LY.rst
+2
-0
Python/_warnings.c
Python/_warnings.c
+198
-119
Python/pylifecycle.c
Python/pylifecycle.c
+1
-1
Python/pystate.c
Python/pystate.c
+4
-0
No files found.
Include/internal/pycore_pylifecycle.h
View file @
86ea5814
...
...
@@ -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
,
...
...
Include/internal/pycore_pystate.h
View file @
86ea5814
...
...
@@ -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
);
...
...
@@ -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
;
...
...
Misc/NEWS.d/next/Core and Builtins/2019-05-07-12-18-11.bpo-36737.XAo6LY.rst
0 → 100644
View file @
86ea5814
Move PyRuntimeState.warnings into per-interpreter state (via "module
state").
Python/_warnings.c
View file @
86ea5814
This diff is collapsed.
Click to expand it.
Python/pylifecycle.c
View file @
86ea5814
...
...
@@ -1288,7 +1288,7 @@ Py_FinalizeEx(void)
PyDict_Fini
();
PySlice_Fini
();
_PyGC_Fini
(
runtime
);
_PyWarnings_Fini
(
runtime
);
_PyWarnings_Fini
(
interp
);
_Py_HashRandomization_Fini
();
_PyArg_Fini
();
PyAsyncGen_Fini
();
...
...
Python/pystate.c
View file @
86ea5814
...
...
@@ -5,6 +5,7 @@
#include "pycore_coreconfig.h"
#include "pycore_pymem.h"
#include "pycore_pystate.h"
#include "pycore_pylifecycle.h"
/* --------------------------------------------------------------------------
CAUTION
...
...
@@ -257,6 +258,9 @@ _PyInterpreterState_Clear(_PyRuntimeState *runtime, PyInterpreterState *interp)
Py_CLEAR
(
interp
->
after_forkers_parent
);
Py_CLEAR
(
interp
->
after_forkers_child
);
#endif
if
(
runtime
->
finalizing
==
NULL
)
{
_PyWarnings_Fini
(
interp
);
}
// XXX Once we have one allocator per interpreter (i.e.
// per-interpreter GC) we must ensure that all of the interpreter's
// objects have been cleaned up at the point.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment