diff options
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r-- | Python/dynload_shlib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 2b5a11a..960e5c0 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -130,7 +130,10 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, handle = dlopen(pathname, dlopenflags); if (handle == NULL) { - PyErr_SetString(PyExc_ImportError, dlerror()); + char *error = dlerror(); + if (error == NULL) + error = "unknown dlopen() error"; + PyErr_SetString(PyExc_ImportError, error); return NULL; } if (fp != NULL && nhandles < 128) |