File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,21 @@ def test_repeated_init_and_inittab(self):
241241
242242 def test_create_module_from_initfunc (self ):
243243 out , err = self .run_embedded_interpreter ("test_create_module_from_initfunc" )
244- self .assertEqual (err , "" )
244+ if support .Py_GIL_DISABLED :
245+ # the test imports a singlephase init extension, so it emits a warning
246+ # under the free-threaded build
247+ expected_runtime_warning = (
248+ "RuntimeWarning: The global interpreter lock (GIL)"
249+ " has been enabled to load module 'embedded_ext'"
250+ )
251+ filtered_err_lines = [
252+ line
253+ for line in err .strip ().splitlines ()
254+ if expected_runtime_warning not in line
255+ ]
256+ self .assertEqual (filtered_err_lines , [])
257+ else :
258+ self .assertEqual (err , "" )
245259 self .assertEqual (out ,
246260 "<module 'my_test_extension' (static-extension)>\n "
247261 "my_test_extension.executed='yes'\n "
You can’t perform that action at this time.
0 commit comments