]> granicus.if.org Git - python/commitdiff
Use a unicode string as unique_key instead of 8-bit string.
authorThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 13:55:37 +0000 (13:55 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 12 Jul 2007 13:55:37 +0000 (13:55 +0000)
Lib/ctypes/test/test_objects.py
Modules/_ctypes/_ctypes.c

index 4c7441c2788a8663b92907cb38f2c2eb73fe7e26..83a8e1b57e0cd659e39e52334b5818ad3b08b7eb 100644 (file)
@@ -22,7 +22,7 @@ assigned from Python must be kept.
 
 >>> array[4] = 'foo bar'
 >>> array._objects
-{s'4': b'foo bar'}
+{'4': b'foo bar'}
 >>> array[4]
 s'foo bar'
 >>>
@@ -47,9 +47,9 @@ of 'x' ('_b_base_' is either None, or the root object owning the memory block):
 
 >>> x.array[0] = 'spam spam spam'
 >>> x._objects
-{s'0:2': b'spam spam spam'}
+{'0:2': b'spam spam spam'}
 >>> x.array._b_base_._objects
-{s'0:2': b'spam spam spam'}
+{'0:2': b'spam spam spam'}
 >>>
 
 '''
index e5c147031f50354008ae58ef59131db2f85832a8..bfb05590cf66a53835d58c4441b09829f9ea1de6 100644 (file)
@@ -2027,7 +2027,7 @@ unique_key(CDataObject *target, Py_ssize_t index)
 #endif
                target = target->b_base;
        }
-       return PyString_FromStringAndSize(string, cp-string);
+       return PyUnicode_FromStringAndSize(string, cp-string);
 }
 
 /*