summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-08-06 13:36:01 (GMT)
committerGuido van Rossum <guido@python.org>1998-08-06 13:36:01 (GMT)
commit0f84a349bb6e83d61ee7fa53743c4ab50656c769 (patch)
tree9e288f384512f5fd73ce2c57b0c21844e23b1026 /Python
parent11274879720d9fa1cedcc34ddbfca3f39a3d68e6 (diff)
downloadcpython-0f84a349bb6e83d61ee7fa53743c4ab50656c769.zip
cpython-0f84a349bb6e83d61ee7fa53743c4ab50656c769.tar.gz
cpython-0f84a349bb6e83d61ee7fa53743c4ab50656c769.tar.bz2
Added handling for Mac code resource modules (Jack Jansen).
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index b859c2b..80e2b8f 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -906,6 +906,12 @@ find_module(name, path, buf, buflen, p_fp)
return &resfiledescr;
}
+ if (PyMac_FindCodeResourceModule((PyStringObject *)v, name, buf)) {
+ static struct filedescr resfiledescr =
+ {"", "", PY_CODERESOURCE};
+
+ return &resfiledescr;
+ }
#endif
if (len > 0 && buf[len-1] != SEP
#ifdef ALTSEP
@@ -1185,6 +1191,9 @@ load_module(name, fp, buf, type)
case PY_RESOURCE:
m = PyMac_LoadResourceModule(name, buf);
break;
+ case PY_CODERESOURCE:
+ m = PyMac_LoadCodeResourceModule(name, buf);
+ break;
#endif
case PKG_DIRECTORY:
@@ -2306,6 +2315,7 @@ initimp()
if (setint(d, "PKG_DIRECTORY", PKG_DIRECTORY) < 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_CODERESOURCE", PY_CODERESOURCE) < 0) goto failure;
failure:
;