Merged revisions 64976-64977 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r64976 | thomas.heller | 2008-07-15 21:39:38 +0200 (Tue, 15 Jul 2008) | 3 lines

  Issue #3313: Contrary to the man page, a failed dlopen() call does not
  always set a dlerror() message.
........
  r64977 | thomas.heller | 2008-07-15 21:44:25 +0200 (Tue, 15 Jul 2008) | 2 lines

  Add Victor Stinner, he provided the patch for issue #3313.
........
This commit is contained in:
Thomas Heller 2008-07-15 19:46:52 +00:00
parent a7024e9e84
commit 15383a08aa
3 changed files with 8 additions and 1 deletions

View file

@ -1383,8 +1383,11 @@ static PyObject *py_dl_open(PyObject *self, PyObject *args)
mode |= RTLD_NOW;
handle = ctypes_dlopen(name, mode);
if (!handle) {
char *errmsg = ctypes_dlerror();
if (!errmsg)
errmsg = "dlopen() error";
PyErr_SetString(PyExc_OSError,
ctypes_dlerror());
errmsg);
return NULL;
}
return PyLong_FromVoidPtr(handle);