mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-46361: Fix "small" int
caching (GH-30583)
This commit is contained in:
parent
09087b8519
commit
5cd9a162cd
5 changed files with 24 additions and 1 deletions
|
@ -1471,6 +1471,13 @@ class LongTest(unittest.TestCase):
|
|||
self.assertEqual(i, 1)
|
||||
self.assertEqual(getattr(i, 'foo', 'none'), 'bar')
|
||||
|
||||
@support.cpython_only
|
||||
def test_from_bytes_small(self):
|
||||
# bpo-46361
|
||||
for i in range(-5, 257):
|
||||
b = i.to_bytes(2, signed=True)
|
||||
self.assertIs(int.from_bytes(b, signed=True), i)
|
||||
|
||||
def test_access_to_nonexistent_digit_0(self):
|
||||
# http://bugs.python.org/issue14630: A bug in _PyLong_Copy meant that
|
||||
# ob_digit[0] was being incorrectly accessed for instances of a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue