diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 50e69826638..888fbfcc68c 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -82,7 +82,8 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname, int i; struct stat statb; if (fstat(fileno(fp), &statb) == -1) { - return PyErr_SetFromErrno(PyExc_IOError); + PyErr_SetFromErrno(PyExc_IOError); + return NULL; } for (i = 0; i < nhandles; i++) { if (statb.st_dev == handles[i].dev &&