mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Added handling for Mac code resource modules (Jack Jansen).
This commit is contained in:
parent
1127487972
commit
0f84a349bb
1 changed files with 10 additions and 0 deletions
|
@ -906,6 +906,12 @@ find_module(name, path, buf, buflen, p_fp)
|
||||||
|
|
||||||
return &resfiledescr;
|
return &resfiledescr;
|
||||||
}
|
}
|
||||||
|
if (PyMac_FindCodeResourceModule((PyStringObject *)v, name, buf)) {
|
||||||
|
static struct filedescr resfiledescr =
|
||||||
|
{"", "", PY_CODERESOURCE};
|
||||||
|
|
||||||
|
return &resfiledescr;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (len > 0 && buf[len-1] != SEP
|
if (len > 0 && buf[len-1] != SEP
|
||||||
#ifdef ALTSEP
|
#ifdef ALTSEP
|
||||||
|
@ -1185,6 +1191,9 @@ load_module(name, fp, buf, type)
|
||||||
case PY_RESOURCE:
|
case PY_RESOURCE:
|
||||||
m = PyMac_LoadResourceModule(name, buf);
|
m = PyMac_LoadResourceModule(name, buf);
|
||||||
break;
|
break;
|
||||||
|
case PY_CODERESOURCE:
|
||||||
|
m = PyMac_LoadCodeResourceModule(name, buf);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
case PKG_DIRECTORY:
|
case PKG_DIRECTORY:
|
||||||
|
@ -2306,6 +2315,7 @@ initimp()
|
||||||
if (setint(d, "PKG_DIRECTORY", PKG_DIRECTORY) < 0) goto failure;
|
if (setint(d, "PKG_DIRECTORY", PKG_DIRECTORY) < 0) goto failure;
|
||||||
if (setint(d, "C_BUILTIN", C_BUILTIN) < 0) goto failure;
|
if (setint(d, "C_BUILTIN", C_BUILTIN) < 0) goto failure;
|
||||||
if (setint(d, "PY_FROZEN", PY_FROZEN) < 0) goto failure;
|
if (setint(d, "PY_FROZEN", PY_FROZEN) < 0) goto failure;
|
||||||
|
if (setint(d, "PY_CODERESOURCE", PY_CODERESOURCE) < 0) goto failure;
|
||||||
|
|
||||||
failure:
|
failure:
|
||||||
;
|
;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue