From 1f15111a6e15d52f6b08907576ec61493cd59358 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 23 Nov 2017 10:43:14 +0100 Subject: bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513) * Py_Main() now reads the PYTHONHOME environment variable * Add _Py_GetPythonHomeWithConfig() private function * Add _PyWarnings_InitWithConfig() * init_filters() doesn't get the current core configuration from the current interpreter or Python thread anymore. Pass explicitly the configuration to _PyWarnings_InitWithConfig(). * _Py_InitializeCore() now fails on _PyWarnings_InitWithConfig() failure. * Pass configuration as constant --- Include/warnings.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Include/warnings.h') diff --git a/Include/warnings.h b/Include/warnings.h index a3f83ff696..25f715e3a8 100644 --- a/Include/warnings.h +++ b/Include/warnings.h @@ -7,6 +7,9 @@ extern "C" { #ifndef Py_LIMITED_API PyAPI_FUNC(PyObject*) _PyWarnings_Init(void); #endif +#ifdef Py_BUILD_CORE +PyAPI_FUNC(PyObject*) _PyWarnings_InitWithConfig(const _PyCoreConfig *config); +#endif PyAPI_FUNC(int) PyErr_WarnEx( PyObject *category, -- cgit v1.2.1