Skip to content

Commit fabec99

Browse files
committed
Minor bug solved in py loader.
1 parent cc0d7f9 commit fabec99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/loaders/py_loader/source/py_loader_impl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3153,6 +3153,7 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path
31533153
loader_impl_py_handle py_handle = py_loader_impl_handle_create(size);
31543154
int run_main = 1;
31553155
size_t iterator;
3156+
PyObject *exception = NULL;
31563157

31573158
if (py_handle == NULL)
31583159
{
@@ -3180,7 +3181,6 @@ loader_handle py_loader_impl_load_from_file(loader_impl impl, const loader_path
31803181
for (iterator = 0; iterator < size; ++iterator)
31813182
{
31823183
int result = 1;
3183-
PyObject *exception = NULL;
31843184

31853185
/* We assume it is a path so we load from path */
31863186
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
32533253
py_loader_impl_error_print(py_impl);
32543254
PyErr_Clear();
32553255
}
3256+
Py_XDECREF(exception);
32563257
error_recursive_call:
32573258
PyGILState_Release(gstate);
32583259
PyEval_RestoreThread(tstate);

0 commit comments

Comments
 (0)