Author: guido.van.rossum
Date: Thu Jul 12 09:44:15 2007
New Revision: 56287

Modified:
   python/branches/py3k-struni/Modules/dlmodule.c
Log:
Use unicode instead of 8-bit strings.
Patch by Alexandre Vassalotti, SF# 1752229.


Modified: python/branches/py3k-struni/Modules/dlmodule.c
==============================================================================
--- python/branches/py3k-struni/Modules/dlmodule.c      (original)
+++ python/branches/py3k-struni/Modules/dlmodule.c      Thu Jul 12 09:44:15 2007
@@ -58,8 +58,8 @@
 {
        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 @@
                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 @@
                        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 {
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to