diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-01 20:29:34 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-01 20:29:34 +0000 |
commit | 1ce3eb5c5b4830e69b21865e2d723e22749544e0 (patch) | |
tree | 324241bc0190ec3316b48ae4f5bd5b20e101bcf0 /Lib/test/test_struct.py | |
parent | 42cb4626820e466177e49c283e37e15375c3efed (diff) | |
download | cpython-git-1ce3eb5c5b4830e69b21865e2d723e22749544e0.tar.gz |
Issue #8990: array.fromstring() and array.tostring() get renamed to
frombytes() and tobytes(), respectively, to avoid confusion. Furthermore,
array.frombytes(), array.extend() as well as the array.array()
constructor now accept bytearray objects. Patch by Thomas Jollans.
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 6ac8fdcc9c..1151662c4a 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -430,12 +430,12 @@ class StructTest(unittest.TestCase): # Test without offset s.pack_into(writable_buf, 0, test_string) - from_buf = writable_buf.tostring()[:len(test_string)] + from_buf = writable_buf.tobytes()[:len(test_string)] self.assertEqual(from_buf, test_string) # Test with offset. s.pack_into(writable_buf, 10, test_string) - from_buf = writable_buf.tostring()[:len(test_string)+10] + from_buf = writable_buf.tobytes()[:len(test_string)+10] self.assertEqual(from_buf, test_string[:10] + test_string) # Go beyond boundaries. @@ -458,12 +458,12 @@ class StructTest(unittest.TestCase): # Test without offset. pack_into(writable_buf, 0, test_string) - from_buf = writable_buf.tostring()[:len(test_string)] + from_buf = writable_buf.tobytes()[:len(test_string)] self.assertEqual(from_buf, test_string) # Test with offset. pack_into(writable_buf, 10, test_string) - from_buf = writable_buf.tostring()[:len(test_string)+10] + from_buf = writable_buf.tobytes()[:len(test_string)+10] self.assertEqual(from_buf, test_string[:10] + test_string) # Go beyond boundaries. |