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 | 43a9f8c9662079658b355f0045968657bb3b684d (patch) | |
tree | c98fb229131ebc575b5c213b2bfdb1e39e4ae17b /Lib/test/test_file.py | |
parent | eda3e00d6d7cb3f5c11948611586bd5a3ccf94da (diff) | |
download | cpython-43a9f8c9662079658b355f0045968657bb3b684d.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_file.py')
-rw-r--r-- | Lib/test/test_file.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index 6d51fd547f..ebaa38beb4 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -44,7 +44,7 @@ class AutoFileTests(unittest.TestCase): a = array('b', b'x'*10) self.f = self.open(TESTFN, 'rb') n = self.f.readinto(a) - self.assertEquals(b'12', a.tostring()[:n]) + self.assertEquals(b'12', a.tobytes()[:n]) def testReadinto_text(self): # verify readinto refuses text files @@ -281,7 +281,7 @@ class OtherFileTests(unittest.TestCase): except ValueError: self.fail("readinto() after next() with supposedly empty " "iteration-buffer failed anyway") - line = buf.tostring() + line = buf.tobytes() if line != testline: self.fail("readinto() after next() with empty buffer " "failed. Got %r, expected %r" % (line, testline)) |