mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-140474: Fix memory leak in array.array (GH-140478)
This commit is contained in:
parent
bd2c7e8c8b
commit
aa9d0a61d5
3 changed files with 13 additions and 0 deletions
|
|
@ -1255,6 +1255,14 @@ def test_typecode_u_deprecation(self):
|
|||
with self.assertWarns(DeprecationWarning):
|
||||
array.array("u")
|
||||
|
||||
def test_empty_string_mem_leak_gh140474(self):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
for _ in range(1000):
|
||||
a = array.array('u', '')
|
||||
self.assertEqual(len(a), 0)
|
||||
self.assertEqual(a.typecode, 'u')
|
||||
|
||||
|
||||
class UCS4Test(UnicodeTest):
|
||||
typecode = 'w'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue