Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 550fdae

Browse files
committed
On the macintosh don't take a quick exit in find_module() for frozen submodule imports: the frozen import goes through a different mechanism.
1 parent 99de218 commit 550fdae

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Python/import.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,21 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
893893
strcat(buf, ".");
894894
strcat(buf, name);
895895
strcpy(name, buf);
896+
#ifdef macintosh
897+
/* Freezing on the mac works different, and the modules are
898+
** actually on sys.path. So we don't take the quick exit but
899+
** continue with the normal flow.
900+
*/
901+
path = NULL;
902+
#else
896903
if (find_frozen(name) != NULL) {
897904
strcpy(buf, name);
898905
return &fd_frozen;
899906
}
900907
PyErr_Format(PyExc_ImportError,
901908
"No frozen submodule named %.200s", name);
902909
return NULL;
910+
#endif
903911
}
904912
if (path == NULL) {
905913
if (is_builtin(name)) {

0 commit comments

Comments
 (0)