mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00

* Call _PyTime_Init() and _PyWarnings_InitState() earlier during the Python initialization. * Inline _PyImportHooks_Init() into _PySys_InitCore(). * The _warnings initialization function no longer call _PyWarnings_InitState() to prevent resetting filters_version to 0. * _PyWarnings_InitState() now returns an int and no longer clear the state in case of error (it's done anyway at Python exit). * Rework init_importlib(), fix refleaks on errors.
25 lines
628 B
C
25 lines
628 B
C
#ifndef Py_INTERNAL_WARNINGS_H
|
|
#define Py_INTERNAL_WARNINGS_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef Py_BUILD_CORE
|
|
# error "this header requires Py_BUILD_CORE define"
|
|
#endif
|
|
|
|
struct _warnings_runtime_state {
|
|
/* Both 'filters' and 'onceregistry' can be set in warnings.py;
|
|
get_warnings_attr() will reset these variables accordingly. */
|
|
PyObject *filters; /* List */
|
|
PyObject *once_registry; /* Dict */
|
|
PyObject *default_action; /* String */
|
|
long filters_version;
|
|
};
|
|
|
|
extern int _PyWarnings_InitState(PyThreadState *tstate);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_INTERNAL_WARNINGS_H */
|