diff -rupN --no-dereference Python-3.10.0rc1/Modules/selectmodule.c Python-3.10.0rc1-new/Modules/selectmodule.c
--- Python-3.10.0rc1/Modules/selectmodule.c 2021-08-02 21:53:59.000000000 +0200
+++ Python-3.10.0rc1-new/Modules/selectmodule.c 2021-08-04 16:37:01.696334274 +0200
@@ -136,9 +136,9 @@ seq2set(PyObject *seq, fd_set *set, pyli
v = PyObject_AsFileDescriptor( o );
if (v == -1) goto finally;
-#if defined(_MSC_VER)
+#if defined(MS_WIN32)
max = 0; /* not used for Win32 */
-#else /* !_MSC_VER */
+#else /* !MS_WIN32 */
if (!_PyIsSelectable_fd(v)) {
PyErr_SetString(PyExc_ValueError,
"filedescriptor out of range in select()");
@@ -146,7 +146,7 @@ seq2set(PyObject *seq, fd_set *set, pyli
}
if (v > max)
max = v;
-#endif /* _MSC_VER */
+#endif /* MS_WIN32 */
FD_SET(v, set);
/* add object and its file descriptor to the list */
diff -rupN --no-dereference Python-3.10.0rc1/setup.py Python-3.10.0rc1-new/setup.py
--- Python-3.10.0rc1/setup.py 2021-08-04 16:37:01.473336519 +0200
+++ Python-3.10.0rc1-new/setup.py 2021-08-04 16:37:01.697334264 +0200
@@ -1001,7 +1001,11 @@ class PyBuildExt(build_ext):
self.missing.append('spwd')
# select(2); not on ancient System V
- self.add(Extension('select', ['selectmodule.c']))
+ select_libs = []
+ if HOST_PLATFORM.startswith(('mingw', 'win')):
+ select_libs += ['ws2_32']
+ self.add(Extension('select', ['selectmodule.c'],
+ libraries=select_libs) )
# Memory-mapped files (also works on Win32).
self.add(Extension('mmap', ['mmapmodule.c']))