Mercurial > cpython-lru_cache-weakref
comparison Python/dynload_os2.c @ 61467:f197407bdba2 3.1
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines
Untabify C files. Will watch buildbots.
........
................
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sun, 09 May 2010 16:14:21 +0000 |
| parents | 94f64f11fdd0 |
| children | 0874698b1201 |
comparison
equal
deleted
inserted
replaced
| 61459:f8c19c5f5dd2 | 61467:f197407bdba2 |
|---|---|
| 8 #include "Python.h" | 8 #include "Python.h" |
| 9 #include "importdl.h" | 9 #include "importdl.h" |
| 10 | 10 |
| 11 | 11 |
| 12 const struct filedescr _PyImport_DynLoadFiletab[] = { | 12 const struct filedescr _PyImport_DynLoadFiletab[] = { |
| 13 {".pyd", "rb", C_EXTENSION}, | 13 {".pyd", "rb", C_EXTENSION}, |
| 14 {".dll", "rb", C_EXTENSION}, | 14 {".dll", "rb", C_EXTENSION}, |
| 15 {0, 0} | 15 {0, 0} |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, | 18 dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, |
| 19 const char *pathname, FILE *fp) | 19 const char *pathname, FILE *fp) |
| 20 { | 20 { |
| 21 dl_funcptr p; | 21 dl_funcptr p; |
| 22 APIRET rc; | 22 APIRET rc; |
| 23 HMODULE hDLL; | 23 HMODULE hDLL; |
| 24 char failreason[256]; | 24 char failreason[256]; |
| 25 char funcname[258]; | 25 char funcname[258]; |
| 26 | 26 |
| 27 rc = DosLoadModule(failreason, | 27 rc = DosLoadModule(failreason, |
| 28 sizeof(failreason), | 28 sizeof(failreason), |
| 29 pathname, | 29 pathname, |
| 30 &hDLL); | 30 &hDLL); |
| 31 | 31 |
| 32 if (rc != NO_ERROR) { | 32 if (rc != NO_ERROR) { |
| 33 char errBuf[256]; | 33 char errBuf[256]; |
| 34 PyOS_snprintf(errBuf, sizeof(errBuf), | 34 PyOS_snprintf(errBuf, sizeof(errBuf), |
| 35 "DLL load failed, rc = %d: %.200s", | 35 "DLL load failed, rc = %d: %.200s", |
| 36 rc, failreason); | 36 rc, failreason); |
| 37 PyErr_SetString(PyExc_ImportError, errBuf); | 37 PyErr_SetString(PyExc_ImportError, errBuf); |
| 38 return NULL; | 38 return NULL; |
| 39 } | 39 } |
| 40 | 40 |
| 41 PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname); | 41 PyOS_snprintf(funcname, sizeof(funcname), "PyInit_%.200s", shortname); |
| 42 rc = DosQueryProcAddr(hDLL, 0L, funcname, &p); | 42 rc = DosQueryProcAddr(hDLL, 0L, funcname, &p); |
| 43 if (rc != NO_ERROR) | 43 if (rc != NO_ERROR) |
| 44 p = NULL; /* Signify Failure to Acquire Entrypoint */ | 44 p = NULL; /* Signify Failure to Acquire Entrypoint */ |
| 45 return p; | 45 return p; |
| 46 } | 46 } |
