From 209abf746985526bce255e2fba97d3246924885d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 22 Jun 2018 19:14:51 +0200 Subject: bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845) Calling Py_Initialize() twice does nothing, instead of failing with a fatal error: restore the Python 3.6 behaviour. --- Python/pylifecycle.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Python') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 958219b744..9bf0ebd35d 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -892,6 +892,11 @@ _Py_InitializeMainInterpreter(const _PyMainInterpreterConfig *config) _PyInitError _Py_InitializeEx_Private(int install_sigs, int install_importlib) { + if (_PyRuntime.initialized) { + /* bpo-33932: Calling Py_Initialize() twice does nothing. */ + return _Py_INIT_OK(); + } + _PyCoreConfig config = _PyCoreConfig_INIT; _PyInitError err; -- cgit v1.2.1