mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
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.
This commit is contained in:
parent
166746c142
commit
6b826abc70
3 changed files with 8 additions and 1 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue