because the path through the code would notice that sys.__path__ did
not exist and it would fall back to the default path (builtins +
sys.path) instead of failing). No longer.
struct filedescr *fdp;
FILE *fp = NULL;
- path = PyObject_GetAttrString(mod, "__path__");
- if (path == NULL)
- PyErr_Clear();
+ if (mod == Py_None)
+ path = NULL;
+ else {
+ path = PyObject_GetAttrString(mod, "__path__");
+ if (path == NULL) {
+ PyErr_Clear();
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
buf[0] = '\0';
fdp = find_module(subname, path,