summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-13 12:07:59 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-13 12:07:59 (GMT)
commit27384da6e863b35fcee3e773c71c497406056458 (patch)
treef791de1153ed54907c3e4b4a87cd53ddb835c792 /Lib
parentace05054d3e146a6fa4435275b83bd8e99327fb1 (diff)
downloadcpython-27384da6e863b35fcee3e773c71c497406056458.zip
cpython-27384da6e863b35fcee3e773c71c497406056458.tar.gz
cpython-27384da6e863b35fcee3e773c71c497406056458.tar.bz2
Do not accept str8 type in function calls any longer.
Accept bytes instead of str8 in the (unexposed in ctypes) BSTR type.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_bytes.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_bytes.py b/Lib/ctypes/test/test_bytes.py
index e6e047a..db2824d 100644
--- a/Lib/ctypes/test/test_bytes.py
+++ b/Lib/ctypes/test/test_bytes.py
@@ -1,5 +1,6 @@
"""Test where byte objects are accepted"""
import unittest
+import sys
from ctypes import *
class BytesTest(unittest.TestCase):
@@ -37,5 +38,14 @@ class BytesTest(unittest.TestCase):
X("abc")
X(b"abc")
+ if sys.platform == "win32":
+ def test_BSTR(self):
+ from _ctypes import _SimpleCData
+ class BSTR(_SimpleCData):
+ _type_ = "X"
+
+ BSTR("abc")
+ BSTR(b"abc")
+
if __name__ == '__main__':
unittest.main()