diff options
author | Alexey Izbyshev <izbyshev@ispras.ru> | 2019-02-12 16:06:43 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2019-02-12 16:06:43 (GMT) |
commit | 16f842da3c862d76a1177bd8ef9579703c24fa5a (patch) | |
tree | 476f517535ce737c62d0d4dcc19a404cc136839f /Lib/test/test__xxsubinterpreters.py | |
parent | b01786c8812c4cc24dd561b5941025bdd6f444c0 (diff) | |
download | cpython-16f842da3c862d76a1177bd8ef9579703c24fa5a.zip cpython-16f842da3c862d76a1177bd8ef9579703c24fa5a.tar.gz cpython-16f842da3c862d76a1177bd8ef9579703c24fa5a.tar.bz2 |
bpo-35972: _xxsubinterpreters: Fix potential integer truncation on 32-bit in channel_send() (gh-11822)
Diffstat (limited to 'Lib/test/test__xxsubinterpreters.py')
-rw-r--r-- | Lib/test/test__xxsubinterpreters.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index 26032d6..1eece96 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -393,7 +393,19 @@ class ShareableTypeTests(unittest.TestCase): for i in range(-1, 258)) def test_int(self): - self._assert_values(range(-1, 258)) + self._assert_values(itertools.chain(range(-1, 258), + [sys.maxsize, -sys.maxsize - 1])) + + def test_non_shareable_int(self): + ints = [ + sys.maxsize + 1, + -sys.maxsize - 2, + 2**1000, + ] + for i in ints: + with self.subTest(i): + with self.assertRaises(OverflowError): + interpreters.channel_send(self.cid, i) ################################## |