Fix bytes warnings in test_struct (added in bpo-29802). (#4068)

This commit is contained in:
Serhiy Storchaka 2017-10-21 21:59:23 +03:00 committed by GitHub
parent db60a5bfa5
commit 73c4708630

View file

@ -614,9 +614,9 @@ class StructTest(unittest.TestCase):
# the Struct object was decrefed twice and the reference to
# deallocated object was left in a cache.
with self.assertRaises(TypeError):
struct.unpack(b'b', 0)
struct.unpack('b', 0)
# Shouldn't crash.
self.assertEqual(struct.unpack(b'b', b'a'), (b'a'[0],))
self.assertEqual(struct.unpack('b', b'a'), (b'a'[0],))
def test_format_attr(self):
s = struct.Struct('=i2H')