summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes/__init__.py
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-12 19:06:25 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-12 19:06:25 (GMT)
commit60831316df8893e973f92592b7c4c95ad489ff15 (patch)
tree6e788f97e7c2874b12540a1cb30c946896efb926 /Lib/ctypes/__init__.py
parentd0762282022ebb9809e488325cf86bb71e1371c0 (diff)
downloadcpython-60831316df8893e973f92592b7c4c95ad489ff15.zip
cpython-60831316df8893e973f92592b7c4c95ad489ff15.tar.gz
cpython-60831316df8893e973f92592b7c4c95ad489ff15.tar.bz2
Accept bytes for c_wchar_p instances and c_wchar array instances.
ctypes.create_unicode_buffer also accepts bytes now. Revert some tests in test_unicode: Since string literals are unicode now, conversion takes place when byte literals are passed as unicode parameters.
Diffstat (limited to 'Lib/ctypes/__init__.py')
-rw-r--r--Lib/ctypes/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index 8c9fe1a..86678ea 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -281,7 +281,7 @@ else:
create_unicode_buffer(anInteger) -> character array
create_unicode_buffer(aString, anInteger) -> character array
"""
- if isinstance(init, str):
+ if isinstance(init, (str, bytes)):
if size is None:
size = len(init)+1
buftype = c_wchar * size