mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)
_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.
This commit is contained in:
parent
e182c660b6
commit
ad56919c5e
3 changed files with 7 additions and 18 deletions
|
@ -1657,15 +1657,11 @@ class MiscTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
self.fail(f"unexpected output: {out!a}")
|
||||
refs = int(match.group(1))
|
||||
blocks = int(match.group(2))
|
||||
self.assertEqual(refs, 0, out)
|
||||
if not MS_WINDOWS:
|
||||
# bpo-46417: Tolerate negative reference count which can occur because
|
||||
# of bugs in C extensions. It is only wrong if it's greater than 0.
|
||||
self.assertLessEqual(refs, 0, out)
|
||||
self.assertEqual(blocks, 0, out)
|
||||
else:
|
||||
# bpo-46857: on Windows, Python still leaks 1 reference and 1
|
||||
# memory block at exit.
|
||||
self.assertLessEqual(refs, 1, out)
|
||||
# bpo-46857: on Windows, Python still leaks 1 memory block at exit
|
||||
self.assertIn(blocks, (0, 1), out)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue