Issue #22161: Conformed arguments type checks in ctype to actually supported
types. Corrected error messages about bytes arguments.
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index e34c646..5c803ff 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -49,7 +49,7 @@
create_string_buffer(anInteger) -> character array
create_string_buffer(aString, anInteger) -> character array
"""
- if isinstance(init, (str, bytes)):
+ if isinstance(init, bytes):
if size is None:
size = len(init)+1
buftype = c_char * size
@@ -284,7 +284,7 @@
create_unicode_buffer(anInteger) -> character array
create_unicode_buffer(aString, anInteger) -> character array
"""
- if isinstance(init, (str, bytes)):
+ if isinstance(init, str):
if size is None:
size = len(init)+1
buftype = c_wchar * size