Skip to content

Commit 623303d

Browse files
committed
Add os platform condition
1 parent 3ce216e commit 623303d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/asyncio/selector_events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@
3232

3333
_HAS_SENDMSG = hasattr(socket.socket, 'sendmsg')
3434

35-
if _HAS_SENDMSG:
35+
if _HAS_SENDMSG and os.name == 'posix':
3636
try:
3737
SC_IOV_MAX = os.sysconf('SC_IOV_MAX')
3838
except OSError:
3939
# Fallback to send
4040
_HAS_SENDMSG = False
41+
else:
42+
# XXX Will it be too big?
43+
SC_IOV_MAX = 1024
4144

4245
def _test_selector_event(selector, fd, event):
4346
# Test if the selector is monitoring 'event' events

0 commit comments

Comments
 (0)