mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
It was possible dlerror() returns a NULL pointer, use a default error message in this case.
This commit is contained in:
parent
789fd005e0
commit
67715f0420
2 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,10 @@ What's New in Python 2.5 alpha 1?
|
||||||
Core and builtins
|
Core and builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- SF Bug #1350188, "setdlopenflags" leads to crash upon "import"
|
||||||
|
It was possible dlerror() returns a NULL pointer, use a default error
|
||||||
|
message in this case.
|
||||||
|
|
||||||
- Replaced most Unicode charmap codecs with new ones using the
|
- Replaced most Unicode charmap codecs with new ones using the
|
||||||
new Unicode translate string feature in the builtin charmap
|
new Unicode translate string feature in the builtin charmap
|
||||||
codec; the codecs were created from the mapping tables available
|
codec; the codecs were created from the mapping tables available
|
||||||
|
|
|
@ -130,7 +130,10 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
|
||||||
handle = dlopen(pathname, dlopenflags);
|
handle = dlopen(pathname, dlopenflags);
|
||||||
|
|
||||||
if (handle == NULL) {
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (fp != NULL && nhandles < 128)
|
if (fp != NULL && nhandles < 128)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue