File tree Expand file tree Collapse file tree
Lib/test/test_concurrent_futures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import gc
22import itertools
3+ import sys
34import threading
45import time
56import weakref
67from concurrent import futures
78from operator import add
9+ from sysconfig import get_config_var
810from test import support
911from test .support import Py_GIL_DISABLED
1012
@@ -67,10 +69,13 @@ def test_map_exception(self):
6769 msg = "next should raise a ZeroDivisionError" ,
6870 )
6971
70- self .assertFalse (
71- gc .get_referrers (error ),
72- msg = "the exception should not have any referrers" ,
73- )
72+ # some referrers may remain for free-threading build on Windows/Linux
73+ is_free_threading = '--disable-gil' in get_config_var ("CONFIG_ARGS" )
74+ if not is_free_threading or sys .platform not in ("linux" , "win32" ):
75+ self .assertFalse (
76+ gc .get_referrers (error ),
77+ msg = "the exception should not have any referrers" ,
78+ )
7479
7580 tb = error .__traceback__
7681 while (tb := tb .tb_next ):
You can’t perform that action at this time.
0 commit comments