diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-24 18:49:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-24 18:49:26 (GMT) |
commit | 713640c4c95df999957b5366fb8cd7f443906858 (patch) | |
tree | 810a234869418937b9d5d9df09605ff24a695c02 /Lib/test | |
parent | ef107ee7a0a8ee27b0a54c542e3918807c981f83 (diff) | |
download | cpython-713640c4c95df999957b5366fb8cd7f443906858.zip cpython-713640c4c95df999957b5366fb8cd7f443906858.tar.gz cpython-713640c4c95df999957b5366fb8cd7f443906858.tar.bz2 |
Issue #29337: Fixed possible BytesWarning when compare the code objects.
Warnings could be emitted at compile time.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_compile.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 824e843..4ea66a4 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -634,6 +634,7 @@ if 1: f1 = ns['f1'] f2 = ns['f2'] self.assertIsNot(f1.__code__, f2.__code__) + self.assertNotEqual(f1.__code__, f2.__code__) self.check_constant(f1, const1) self.check_constant(f2, const2) self.assertEqual(repr(f1()), repr(const1)) @@ -642,6 +643,8 @@ if 1: check_different_constants(0, 0.0) check_different_constants(+0.0, -0.0) check_different_constants((0,), (0.0,)) + check_different_constants('a', b'a') + check_different_constants(('a',), (b'a',)) # check_different_constants() cannot be used because repr(-0j) is # '(-0-0j)', but when '(-0-0j)' is evaluated to 0j: we loose the sign. |