mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107)
if it is called with a sequence or set, but not list or tuple.
This commit is contained in:
parent
81989058de
commit
f572cbf1fa
3 changed files with 12 additions and 2 deletions
|
@ -43,8 +43,14 @@ def get_tk_patchlevel():
|
|||
class TkinterTest(unittest.TestCase):
|
||||
|
||||
def testFlattenLen(self):
|
||||
# flatten(<object with no length>)
|
||||
# Object without length.
|
||||
self.assertRaises(TypeError, _tkinter._flatten, True)
|
||||
# Object with length, but not sequence.
|
||||
self.assertRaises(TypeError, _tkinter._flatten, {})
|
||||
# Sequence or set, but not tuple or list.
|
||||
# (issue44608: there were leaks in the following cases)
|
||||
self.assertRaises(TypeError, _tkinter._flatten, 'string')
|
||||
self.assertRaises(TypeError, _tkinter._flatten, {'set'})
|
||||
|
||||
|
||||
class TclTest(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue