We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45b1b9c commit 36dd0feCopy full SHA for 36dd0fe
Programs/_testembed.c
@@ -2329,16 +2329,11 @@ int
2329
mp_pkg_exec(PyObject *mod)
2330
{
2331
// make this a namespace package
2332
- PyObject *path_list = PyList_New(0); // empty list = namespace package
2333
- if (!path_list) {
2334
- return -1;
2335
- }
2336
- if (PyModule_AddObject(mod, "__path__", path_list) < 0) {
2337
- Py_DECREF(path_list);
+ // empty list = namespace package
+ if (PyModule_Add(mod, "__path__", PyList_New(0)) < 0) {
2338
return -1;
2339
}
2340
if (PyModule_AddStringConstant(mod, "mp_pkg_exec_slot_ran", "yes") < 0) {
2341
2342
2343
2344
return 0;
0 commit comments