diff options
author | Guido van Rossum <guido@python.org> | 2007-05-09 00:01:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-09 00:01:30 (GMT) |
commit | e6d3904c224b6c53abc3a807158e677f0233d143 (patch) | |
tree | dc6c7cac2173201b63c41165e7bacec6ce9fb8bb /Lib | |
parent | bc14efbd08a0f9fce88b13b670df26e70f912104 (diff) | |
download | cpython-e6d3904c224b6c53abc3a807158e677f0233d143.zip cpython-e6d3904c224b6c53abc3a807158e677f0233d143.tar.gz cpython-e6d3904c224b6c53abc3a807158e677f0233d143.tar.bz2 |
Make test_marshal pass. Not my best work. :-(
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_marshal.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index 7f7c5e6..2af6ae7 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -27,18 +27,18 @@ class IntTestCase(unittest.TestCase): # we're running the test on a 32-bit box, of course. def to_little_endian_string(value, nbytes): - bytes = [] + b = bytes() for i in range(nbytes): - bytes.append(chr(value & 0xff)) + b.append(value & 0xff) value >>= 8 - return ''.join(bytes) + return b maxint64 = (1 << 63) - 1 minint64 = -maxint64-1 for base in maxint64, minint64, -maxint64, -(minint64 >> 1): while base: - s = 'I' + to_little_endian_string(base, 8) + s = b'I' + to_little_endian_string(base, 8) got = marshal.loads(s) self.assertEqual(base, got) if base == -1: # a fixed-point for shifting right 1 @@ -128,7 +128,7 @@ class StringTestCase(unittest.TestCase): os.unlink(test_support.TESTFN) def test_buffer(self): - for s in ["", "Andrč Previn", "abc", " "*10000]: + for s in [b"", b"Andr\xe8 Previn", b"abc", b" "*10000]: b = buffer(s) new = marshal.loads(marshal.dumps(b)) self.assertEqual(s, new) |