File tree 1 file changed +10
-4
lines changed
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):
1657
1657
self .fail (f"unexpected output: { out !a} " )
1658
1658
refs = int (match .group (1 ))
1659
1659
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 )
1664
1670
1665
1671
1666
1672
class StdPrinterTests (EmbeddingTestsMixin , unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments