mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
GH-98897: fix memory leak if math.dist
raises exception (GH-98898)
This commit is contained in:
parent
88297e2a8a
commit
ab57505070
3 changed files with 9 additions and 3 deletions
|
@ -1006,6 +1006,11 @@ class MathTests(unittest.TestCase):
|
|||
self.assertEqual(math.dist(p, q), 5*scale)
|
||||
self.assertEqual(math.dist(q, p), 5*scale)
|
||||
|
||||
def test_math_dist_leak(self):
|
||||
# gh-98897: Check for error handling does not leak memory
|
||||
with self.assertRaises(ValueError):
|
||||
math.dist([1, 2], [3, 4, 5])
|
||||
|
||||
def testIsqrt(self):
|
||||
# Test a variety of inputs, large and small.
|
||||
test_values = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue