diff -rupN --no-dereference Python-3.8.2/Modules/selectmodule.c Python-3.8.2-new/Modules/selectmodule.c
--- Python-3.8.2/Modules/selectmodule.c 2020-02-24 22:36:25.000000000 +0100
+++ Python-3.8.2-new/Modules/selectmodule.c 2020-03-02 13:05:25.806162122 +0100
@@ -134,9 +134,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()");
@@ -144,7 +144,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.8.2/setup.py Python-3.8.2-new/setup.py
--- Python-3.8.2/setup.py 2020-03-02 13:05:25.603170955 +0100
+++ Python-3.8.2-new/setup.py 2020-03-02 13:05:25.807162079 +0100
@@ -828,7 +828,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) )
# Fred Drake's interface to the Python parser
self.add(Extension('parser', ['parsermodule.c']))