From fabec99a9e8ec9e19eef21e32b768363e2e6cd49 Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia Date: Tue, 20 Feb 2024 23:29:43 +0100 Subject: [PATCH] Minor bug solved in py loader. --- source/loaders/py_loader/source/py_loader_impl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/loaders/py_loader/source/py_loader_impl.c b/source/loaders/py_loader/source/py_loader_impl.c index 8f88de6b9..eddab4232 100644 --- a/source/loaders/py_loader/source/py_loader_impl.c +++ b/source/loaders/py_loader/source/py_loader_impl.c @@ -3153,6 +3153,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path loader_impl_py_handle py_handle = py_loader_impl_handle_create(size); int run_main = 1; size_t iterator; + PyObject *exception = NULL; if (py_handle == NULL) { @@ -3180,7 +3181,6 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path for (iterator = 0; iterator < size; ++iterator) { int result = 1; - PyObject *exception = NULL; /* We assume it is a path so we load from path */ if (portability_path_is_absolute(paths[iterator], strnlen(paths[iterator], LOADER_PATH_SIZE) + 1) == 0) @@ -3253,6 +3253,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path py_loader_impl_error_print(py_impl); PyErr_Clear(); } + Py_XDECREF(exception); error_recursive_call: PyGILState_Release(gstate); PyEval_RestoreThread(tstate);