Skip to content

Commit 9d61f7a

Browse files
authored
Update Programs/_testembed.c
1 parent 36dd0fe commit 9d61f7a

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Programs/_testembed.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,13 +2443,8 @@ PyInit_sp_pkg(void)
24432443
return NULL;
24442444
}
24452445
// make this a namespace package
2446-
PyObject *path_list = PyList_New(0); // empty list = namespace package
2447-
if (!path_list) {
2448-
Py_DECREF(mod);
2449-
return NULL;
2450-
}
2451-
if (PyModule_AddObject(mod, "__path__", path_list) < 0) {
2452-
Py_DECREF(path_list);
2446+
// empty list = namespace package
2447+
if (PyModule_Add(mod, "__path__", PyList_New(0)) < 0) {
24532448
Py_DECREF(mod);
24542449
return NULL;
24552450
}

0 commit comments

Comments
 (0)