diff options
author | Thomas Heller <theller@ctypes.org> | 2008-07-15 19:39:38 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2008-07-15 19:39:38 (GMT) |
commit | 880f529c04a5093e017bd41cf976ac62539a132c (patch) | |
tree | 406c385357c53db89c939dea359c4c20731011a7 /Modules/dlmodule.c | |
parent | 7103aa42c0d3ce8d75c9a9e299cf4d9b0be544de (diff) | |
download | cpython-880f529c04a5093e017bd41cf976ac62539a132c.zip cpython-880f529c04a5093e017bd41cf976ac62539a132c.tar.gz cpython-880f529c04a5093e017bd41cf976ac62539a132c.tar.bz2 |
Issue #3313: Contrary to the man page, a failed dlopen() call does not
always set a dlerror() message.
Diffstat (limited to 'Modules/dlmodule.c')
-rw-r--r-- | Modules/dlmodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/dlmodule.c b/Modules/dlmodule.c index ccf1cb1..b2ea4f5 100644 --- a/Modules/dlmodule.c +++ b/Modules/dlmodule.c @@ -186,7 +186,10 @@ dl_open(PyObject *self, PyObject *args) } handle = dlopen(name, mode); if (handle == NULL) { - PyErr_SetString(Dlerror, dlerror()); + char *errmsg = dlerror(); + if (!errmsg) + errmsg = "dlopen() error"; + PyErr_SetString(Dlerror, errmsg); return NULL; } #ifdef __VMS |