diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-26 23:28:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-26 23:28:24 (GMT) |
commit | ad56919c5ed54523f866e6605a2573ab7b7d5235 (patch) | |
tree | 1cc23ffd1c3f58b123ff0936852a08bb86f32b88 /Lib/test/test_embed.py | |
parent | e182c660b63bc23420fb9f0593d77a3fa3b7f1c7 (diff) | |
download | cpython-ad56919c5ed54523f866e6605a2573ab7b7d5235.zip cpython-ad56919c5ed54523f866e6605a2573ab7b7d5235.tar.gz cpython-ad56919c5ed54523f866e6605a2573ab7b7d5235.tar.bz2 |
bpo-46857: Fix refleak in OSError INIT_ALIAS() (GH-31594)
_Py_GetRefTotal() no longer decrements _PySet_Dummy refcount.
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r-- | Lib/test/test_embed.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 450bbec..80b9674 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -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) |