Skip to content

Commit b18c679

Browse files
committed
Pass with -Werror
1 parent e2c9c7e commit b18c679

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Lib/test/test_import/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,9 +3424,12 @@ def test_from_modexport_gil_used(self):
34243424
enabled_before = sys._is_gil_enabled()
34253425
interp.exec(f"""if True:
34263426
import sys
3427+
from test.support.warnings_helper import check_warnings
34273428
from {__name__} import import_extension_from_file
3428-
module = import_extension_from_file(modname, filename,
3429-
put_in_sys_modules=False)
3429+
with check_warnings((".*GIL..has been enabled.*", RuntimeWarning),
3430+
quiet=True):
3431+
module = import_extension_from_file(modname, filename,
3432+
put_in_sys_modules=False)
34303433
queue.put(module.__name__)
34313434
queue.put(sys._is_gil_enabled())
34323435
""")
@@ -3474,9 +3477,12 @@ def test_from_modexport_create_nonmodule_gil_used(self):
34743477
enabled_before = sys._is_gil_enabled()
34753478
interp.exec(f"""if True:
34763479
import sys
3480+
from test.support.warnings_helper import check_warnings
34773481
from {__name__} import import_extension_from_file
3478-
module = import_extension_from_file(modname, filename,
3479-
put_in_sys_modules=False)
3482+
with check_warnings((".*GIL..has been enabled.*", RuntimeWarning),
3483+
quiet=True):
3484+
module = import_extension_from_file(modname, filename,
3485+
put_in_sys_modules=False)
34803486
queue.put(module)
34813487
queue.put(sys._is_gil_enabled())
34823488
""")

0 commit comments

Comments
 (0)