Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(164921)

Delta Between Two Patch Sets: Python/dynload_next.c

Issue 14040: Deprecate some of the module file formats
Left Patch Set: Created 7 years, 9 months ago
Right Patch Set: Created 7 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Python/dynload_hpux.c ('k') | Python/dynload_shlib.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 1
2 /* Support for dynamic loading of extension modules on Mac OS X 2 /* Support for dynamic loading of extension modules on Mac OS X
3 ** All references to "NeXT" are for historical reasons. 3 ** All references to "NeXT" are for historical reasons.
4 */ 4 */
5 5
6 #include "Python.h" 6 #include "Python.h"
7 #include "importdl.h" 7 #include "importdl.h"
8 8
9 #include <mach-o/dyld.h> 9 #include <mach-o/dyld.h>
10 10
11 const struct filedescr _PyImport_DynLoadFiletab[] = { 11 const struct filedescr _PyImport_DynLoadFiletab[] = {
12 {".so", "rb", C_EXTENSION, 0}, 12 {".so", "rb", C_EXTENSION},
13 {"module.so", "rb", C_EXTENSION, 1},
14 {0, 0} 13 {0, 0}
15 }; 14 };
16 15
17 /* 16 /*
18 ** Python modules are Mach-O MH_BUNDLE files. The best way to load these 17 ** Python modules are Mach-O MH_BUNDLE files. The best way to load these
19 ** is each in a private namespace, so you can load, say, a module bar and a 18 ** is each in a private namespace, so you can load, say, a module bar and a
20 ** module foo.bar. If we load everything in the global namespace the two 19 ** module foo.bar. If we load everything in the global namespace the two
21 ** initbar() symbols will conflict. 20 ** initbar() symbols will conflict.
22 ** However, it seems some extension packages depend upon being able to access 21 ** However, it seems some extension packages depend upon being able to access
23 ** each others' global symbols. There seems to be no way to eat our cake and 22 ** each others' global symbols. There seems to be no way to eat our cake and
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 /* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC c ode */ 104 /* NSUnLinkModule(newModule, FALSE); removed: causes problems for ObjC c ode */
106 PyErr_Format(PyExc_ImportError, 105 PyErr_Format(PyExc_ImportError,
107 "Loaded module does not contain symbol %.200s", 106 "Loaded module does not contain symbol %.200s",
108 funcname); 107 funcname);
109 return NULL; 108 return NULL;
110 } 109 }
111 #endif 110 #endif
112 p = (dl_funcptr)NSAddressOfSymbol(theSym); 111 p = (dl_funcptr)NSAddressOfSymbol(theSym);
113 return p; 112 return p;
114 } 113 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+