]> granicus.if.org Git - python/commitdiff
Added handling for Mac code resource modules (Jack Jansen).
authorGuido van Rossum <guido@python.org>
Thu, 6 Aug 1998 13:36:01 +0000 (13:36 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 6 Aug 1998 13:36:01 +0000 (13:36 +0000)
Python/import.c

index b859c2b5690cc36c50cdc63c5edda94e88e9ead3..80e2b8f1eed02d4de9710eebc0ca1f81216ba9b0 100644 (file)
@@ -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:
        ;