mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Reindented some OS/2 and hpux code that looked ugly or at least
inconsistent.
This commit is contained in:
parent
7ba30431ec
commit
bb71ab68f9
1 changed files with 28 additions and 29 deletions
|
@ -509,24 +509,25 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
|
||||||
{
|
{
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
HMODULE hDLL;
|
HMODULE hDLL;
|
||||||
char failreason[256];
|
char failreason[256];
|
||||||
|
|
||||||
rc = DosLoadModule(failreason,
|
rc = DosLoadModule(failreason,
|
||||||
sizeof(failreason),
|
sizeof(failreason),
|
||||||
pathname,
|
pathname,
|
||||||
&hDLL);
|
&hDLL);
|
||||||
|
|
||||||
if (rc != NO_ERROR) {
|
if (rc != NO_ERROR) {
|
||||||
char errBuf[256];
|
char errBuf[256];
|
||||||
sprintf(errBuf,
|
sprintf(errBuf,
|
||||||
"DLL load failed, rc = %d, problem '%s': %s", rc, failreason);
|
"DLL load failed, rc = %d, problem '%s': %s",
|
||||||
|
rc, failreason);
|
||||||
PyErr_SetString(PyExc_ImportError, errBuf);
|
PyErr_SetString(PyExc_ImportError, errBuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = DosQueryProcAddr(hDLL, 0L, funcname, &p);
|
rc = DosQueryProcAddr(hDLL, 0L, funcname, &p);
|
||||||
if (rc != NO_ERROR)
|
if (rc != NO_ERROR)
|
||||||
p = NULL; /* Signify Failure to Acquire Entrypoint */
|
p = NULL; /* Signify Failure to Acquire Entrypoint */
|
||||||
}
|
}
|
||||||
#endif /* PYOS_OS2 */
|
#endif /* PYOS_OS2 */
|
||||||
|
|
||||||
|
@ -574,28 +575,26 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
flags = BIND_FIRST | BIND_DEFERRED;
|
flags = BIND_FIRST | BIND_DEFERRED;
|
||||||
if (Py_VerboseFlag)
|
if (Py_VerboseFlag) {
|
||||||
{
|
flags = DYNAMIC_PATH | BIND_FIRST | BIND_IMMEDIATE |
|
||||||
flags = DYNAMIC_PATH | BIND_FIRST | BIND_IMMEDIATE |
|
|
||||||
BIND_NONFATAL | BIND_VERBOSE;
|
BIND_NONFATAL | BIND_VERBOSE;
|
||||||
printf("shl_load %s\n",pathname);
|
printf("shl_load %s\n",pathname);
|
||||||
}
|
}
|
||||||
lib = shl_load(pathname, flags, 0);
|
lib = shl_load(pathname, flags, 0);
|
||||||
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
|
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
|
||||||
if (lib == NULL)
|
if (lib == NULL) {
|
||||||
{
|
char buf[256];
|
||||||
char buf[256];
|
if (Py_VerboseFlag)
|
||||||
if (Py_VerboseFlag)
|
perror(pathname);
|
||||||
perror(pathname);
|
sprintf(buf, "Failed to load %.200s", pathname);
|
||||||
sprintf(buf, "Failed to load %.200s", pathname);
|
PyErr_SetString(PyExc_ImportError, buf);
|
||||||
PyErr_SetString(PyExc_ImportError, buf);
|
return NULL;
|
||||||
return NULL;
|
}
|
||||||
}
|
if (Py_VerboseFlag)
|
||||||
if (Py_VerboseFlag)
|
printf("shl_findsym %s\n", funcname);
|
||||||
printf("shl_findsym %s\n", funcname);
|
shl_findsym(&lib, funcname, TYPE_UNDEFINED, (void *) &p);
|
||||||
shl_findsym(&lib, funcname, TYPE_UNDEFINED, (void *) &p);
|
if (p == NULL && Py_VerboseFlag)
|
||||||
if (p == NULL && Py_VerboseFlag)
|
perror(funcname);
|
||||||
perror(funcname);
|
|
||||||
}
|
}
|
||||||
#endif /* hpux */
|
#endif /* hpux */
|
||||||
#ifdef USE_SHLIB
|
#ifdef USE_SHLIB
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue