diff options
author | Guido van Rossum <guido@python.org> | 2007-07-12 07:44:15 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-12 07:44:15 (GMT) |
commit | dc09715d0bb43a8e7d0a33486e3f07976309df12 (patch) | |
tree | ab916181e3e688c896e60ae0c782ee9733089f95 /Modules | |
parent | c3e7ffc670aab58e514b601ed810654a1a428f17 (diff) | |
download | cpython-dc09715d0bb43a8e7d0a33486e3f07976309df12.zip cpython-dc09715d0bb43a8e7d0a33486e3f07976309df12.tar.gz cpython-dc09715d0bb43a8e7d0a33486e3f07976309df12.tar.bz2 |
Use unicode instead of 8-bit strings.
Patch by Alexandre Vassalotti, SF# 1752229.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/dlmodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/dlmodule.c b/Modules/dlmodule.c index 4af7e30..5654f10 100644 --- a/Modules/dlmodule.c +++ b/Modules/dlmodule.c @@ -58,8 +58,8 @@ dl_sym(dlobject *xp, PyObject *args) { char *name; PyUnivPtr *func; - if (PyString_Check(args)) { - name = PyString_AS_STRING(args); + if (PyUnicode_Check(args)) { + name = PyUnicode_AsString(args); } else { PyErr_Format(PyExc_TypeError, "expected string, found %.200s", args->ob_type->tp_name); @@ -88,14 +88,14 @@ dl_call(dlobject *xp, PyObject *args) return NULL; } name = PyTuple_GetItem(args, 0); - if (!PyString_Check(name)) { + if (!PyUnicode_Check(name)) { PyErr_SetString(PyExc_TypeError, "function name must be a string"); return NULL; } func = (long (*)(long, long, long, long, long, long, long, long, long, long)) - dlsym(xp->dl_handle, PyString_AsString(name)); + dlsym(xp->dl_handle, PyUnicode_AsString(name)); if (func == NULL) { PyErr_SetString(PyExc_ValueError, dlerror()); return NULL; @@ -111,8 +111,8 @@ dl_call(dlobject *xp, PyObject *args) alist[i-1] = PyInt_AsLong(v); if (alist[i-1] == -1 && PyErr_Occurred()) return NULL; - } else if (PyString_Check(v)) - alist[i-1] = (long)PyString_AsString(v); + } else if (PyUnicode_Check(v)) + alist[i-1] = (long)PyUnicode_AsString(v); else if (v == Py_None) alist[i-1] = (long) ((char *)NULL); else { |