Skip to content

Commit e77715e

Browse files
gh-152548: Skip test_eintr where fcntl is unavailable
test_eintr.py was renamed from the never-collected _test_eintr.py, so its top-level "import fcntl" now runs on every platform and crashed the module import on Windows and WASI. Import fcntl through import_helper so the whole module is skipped there instead, as the EINTR tests only run on Unix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 09ef4ee commit e77715e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/test/test_eintr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import contextlib
1212
import faulthandler
13-
import fcntl
1413
import os
1514
import platform
1615
import select
@@ -23,10 +22,15 @@
2322
import unittest
2423

2524
from test import support
25+
from test.support import import_helper
2626
from test.support import isolation
2727
from test.support import os_helper
2828
from test.support import socket_helper
2929

30+
# This module is collected on every platform, but the EINTR tests only run on
31+
# Unix; skip the whole module where fcntl (and thus the rest) is unavailable.
32+
fcntl = import_helper.import_module('fcntl')
33+
3034

3135
# gh-109592: Tolerate a difference of 20 ms when comparing timings
3236
# (clock resolution)

0 commit comments

Comments
 (0)