summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-03 16:22:09 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-03 16:22:09 (GMT)
commit6b826abc707eb101f8426382487de88cd4e7b046 (patch)
tree4f56a78f9a4108866b265a7acbd89ba5e3aa6994 /Lib/test/test_array.py
parent166746c142a88d4f27541f6102154cc592f208ee (diff)
downloadcpython-6b826abc707eb101f8426382487de88cd4e7b046.zip
cpython-6b826abc707eb101f8426382487de88cd4e7b046.tar.gz
cpython-6b826abc707eb101f8426382487de88cd4e7b046.tar.bz2
Creating an array with a bytes object as initializer
should treat the bytes as it treats a string. Not doing this broke re.compile() of big charsets.
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 9b11edf..cf5c2e8 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -700,6 +700,10 @@ class BaseTest(unittest.TestCase):
# SF bug #1486663 -- this used to erroneously raise a TypeError
ArraySubclassWithKwargs('b', newarg=1)
+ def test_create_from_bytes(self):
+ a = array.array('H', b"1234")
+ self.assertEqual(len(a) * a.itemsize, 4)
+
class StringTest(BaseTest):