summaryrefslogtreecommitdiff
path: root/Python/dynload_hpux.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-04-29 11:48:54 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2012-04-29 11:48:54 +0300
commitce4b511ca279b2898d2f7a13b6efe095690bcdc1 (patch)
tree9e1a28a02f873241d6a3ad472e82cca094bb6c1b /Python/dynload_hpux.c
parentfca739226ac00e6010c8dc236a3a68efa0b85100 (diff)
parentc22734e8102a45943208dfa1fff00e481d63cc45 (diff)
downloadcpython-ce4b511ca279b2898d2f7a13b6efe095690bcdc1.tar.gz
#14519: merge with 3.2.
Diffstat (limited to 'Python/dynload_hpux.c')
-rw-r--r--Python/dynload_hpux.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/Python/dynload_hpux.c b/Python/dynload_hpux.c
index 18a81377f2..6f0f2527b6 100644
--- a/Python/dynload_hpux.c
+++ b/Python/dynload_hpux.c
@@ -15,11 +15,10 @@
const struct filedescr _PyImport_DynLoadFiletab[] = {
{SHLIB_EXT, "rb", C_EXTENSION},
- {"module"SHLIB_EXT, "rb", C_EXTENSION},
{0, 0}
};
-dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
+dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
const char *pathname, FILE *fp)
{
dl_funcptr p;
@@ -37,11 +36,21 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
/* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */
if (lib == NULL) {
char buf[256];
+ PyObject *pathname_ob = NULL;
+ PyObject *buf_ob = NULL;
+ PyObject *shortname_ob = NULL;
+
if (Py_VerboseFlag)
perror(pathname);
PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s",
pathname);
- PyErr_SetString(PyExc_ImportError, buf);
+ buf_ob = PyUnicode_FromString(buf);
+ shortname_ob = PyUnicode_FromString(shortname);
+ pathname_ob = PyUnicode_FromString(pathname);
+ PyErr_SetImportError(buf_ob, shortname_ob, pathname_ob);
+ Py_DECREF(buf_ob);
+ Py_DECREF(shortname_ob);
+ Py_DECREF(pathname_ob);
return NULL;
}
PyOS_snprintf(funcname, sizeof(funcname), FUNCNAME_PATTERN, shortname);