File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1657,10 +1657,16 @@ def test_no_memleak(self):
16571657 self .fail (f"unexpected output: { out !a} " )
16581658 refs = int (match .group (1 ))
16591659 blocks = int (match .group (2 ))
1660- # bpo-46417: Tolerate negative reference count which can occur because
1661- # of bugs in C extensions. It is only wrong if it's greater than 0.
1662- self .assertLessEqual (refs , 0 , out )
1663- self .assertEqual (blocks , 0 , out )
1660+ if not MS_WINDOWS :
1661+ # bpo-46417: Tolerate negative reference count which can occur because
1662+ # of bugs in C extensions. It is only wrong if it's greater than 0.
1663+ self .assertLessEqual (refs , 0 , out )
1664+ self .assertEqual (blocks , 0 , out )
1665+ else :
1666+ # bpo-46857: on Windows, Python still leaks 1 reference and 1
1667+ # memory block at exit.
1668+ self .assertLessEqual (refs , 1 , out )
1669+ self .assertIn (blocks , (0 , 1 ), out )
16641670
16651671
16661672class StdPrinterTests (EmbeddingTestsMixin , unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments