[Python-3000-checkins] r56317 - in python/branches/py3k-struni: Lib/ctypes/test/test_objects.py Modules/_ctypes/_ctypes.c
thomas.heller
python-3000-checkins at python.org
Thu Jul 12 15:55:37 CEST 2007
Author: thomas.heller
Date: Thu Jul 12 15:55:37 2007
New Revision: 56317
Modified:
python/branches/py3k-struni/Lib/ctypes/test/test_objects.py
python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
Log:
Use a unicode string as unique_key instead of 8-bit string.
Modified: python/branches/py3k-struni/Lib/ctypes/test/test_objects.py
==============================================================================
--- python/branches/py3k-struni/Lib/ctypes/test/test_objects.py (original)
+++ python/branches/py3k-struni/Lib/ctypes/test/test_objects.py Thu Jul 12 15:55:37 2007
@@ -22,7 +22,7 @@
>>> array[4] = 'foo bar'
>>> array._objects
-{s'4': b'foo bar'}
+{'4': b'foo bar'}
>>> array[4]
s'foo bar'
>>>
@@ -47,9 +47,9 @@
>>> 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'}
>>>
'''
Modified: python/branches/py3k-struni/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/branches/py3k-struni/Modules/_ctypes/_ctypes.c (original)
+++ python/branches/py3k-struni/Modules/_ctypes/_ctypes.c Thu Jul 12 15:55:37 2007
@@ -2027,7 +2027,7 @@
#endif
target = target->b_base;
}
- return PyString_FromStringAndSize(string, cp-string);
+ return PyUnicode_FromStringAndSize(string, cp-string);
}
/*
More information about the Python-3000-checkins
mailing list