Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb71ab6

Browse files
committed
Reindented some OS/2 and hpux code that looked ugly or at least
inconsistent.
1 parent 7ba3043 commit bb71ab6

1 file changed

Lines changed: 28 additions & 29 deletions

File tree

Python/importdl.c

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -509,24 +509,25 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
509509
{
510510
APIRET rc;
511511
HMODULE hDLL;
512-
char failreason[256];
512+
char failreason[256];
513513

514514
rc = DosLoadModule(failreason,
515-
sizeof(failreason),
516-
pathname,
517-
&hDLL);
515+
sizeof(failreason),
516+
pathname,
517+
&hDLL);
518518

519519
if (rc != NO_ERROR) {
520520
char errBuf[256];
521521
sprintf(errBuf,
522-
"DLL load failed, rc = %d, problem '%s': %s", rc, failreason);
522+
"DLL load failed, rc = %d, problem '%s': %s",
523+
rc, failreason);
523524
PyErr_SetString(PyExc_ImportError, errBuf);
524525
return NULL;
525526
}
526527

527-
rc = DosQueryProcAddr(hDLL, 0L, funcname, &p);
528-
if (rc != NO_ERROR)
529-
p = NULL; /* Signify Failure to Acquire Entrypoint */
528+
rc = DosQueryProcAddr(hDLL, 0L, funcname, &p);
529+
if (rc != NO_ERROR)
530+
p = NULL; /* Signify Failure to Acquire Entrypoint */
530531
}
531532
#endif /* PYOS_OS2 */
532533

@@ -574,28 +575,26 @@ _PyImport_LoadDynamicModule(name, pathname, fp)
574575
int flags;
575576

576577
flags = BIND_FIRST | BIND_DEFERRED;
577-
if (Py_VerboseFlag)
578-
{
579-
flags = DYNAMIC_PATH | BIND_FIRST | BIND_IMMEDIATE |
578+
if (Py_VerboseFlag) {
579+
flags = DYNAMIC_PATH | BIND_FIRST | BIND_IMMEDIATE |
580580
BIND_NONFATAL | BIND_VERBOSE;
581-
printf("shl_load %s\n",pathname);
582-
}
583-
lib = shl_load(pathname, flags, 0);
584-
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
585-
if (lib == NULL)
586-
{
587-
char buf[256];
588-
if (Py_VerboseFlag)
589-
perror(pathname);
590-
sprintf(buf, "Failed to load %.200s", pathname);
591-
PyErr_SetString(PyExc_ImportError, buf);
592-
return NULL;
593-
}
594-
if (Py_VerboseFlag)
595-
printf("shl_findsym %s\n", funcname);
596-
shl_findsym(&lib, funcname, TYPE_UNDEFINED, (void *) &p);
597-
if (p == NULL && Py_VerboseFlag)
598-
perror(funcname);
581+
printf("shl_load %s\n",pathname);
582+
}
583+
lib = shl_load(pathname, flags, 0);
584+
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
585+
if (lib == NULL) {
586+
char buf[256];
587+
if (Py_VerboseFlag)
588+
perror(pathname);
589+
sprintf(buf, "Failed to load %.200s", pathname);
590+
PyErr_SetString(PyExc_ImportError, buf);
591+
return NULL;
592+
}
593+
if (Py_VerboseFlag)
594+
printf("shl_findsym %s\n", funcname);
595+
shl_findsym(&lib, funcname, TYPE_UNDEFINED, (void *) &p);
596+
if (p == NULL && Py_VerboseFlag)
597+
perror(funcname);
599598
}
600599
#endif /* hpux */
601600
#ifdef USE_SHLIB

0 commit comments

Comments
 (0)