[Python-checkins] Fix bytes warnings in test_struct (added in bpo-29802). (#4068)

Serhiy Storchaka webhook-mailer at python.org
Sat Oct 21 14:59:26 EDT 2017


https://github.com/python/cpython/commit/73c4708630f99b94c35476529748629fff1fc63e
commit: 73c4708630f99b94c35476529748629fff1fc63e
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-10-21T21:59:23+03:00
summary:

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

files:
M Lib/test/test_struct.py

diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index a896468848e..8fd56c91cb7 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -614,9 +614,9 @@ def test_issue29802(self):
         # 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')



More information about the Python-checkins mailing list