Skip to content

Commit 0b0ad35

Browse files
committed
patch 8.1.1361: Python setuptools don't work with Python 3
Problem: Python setuptools don't work with Python 3. Solution: Add dummy implementation for find_module. (Joel Frederico, closes #4402, closes #3984
1 parent 80341bc commit 0b0ad35

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/if_py_both.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,14 @@ FinderFindSpec(PyObject *self, PyObject *args)
12221222

12231223
return spec;
12241224
}
1225+
1226+
static PyObject *
1227+
FinderFindModule(PyObject* self UNUSED, PyObject* args UNUSED)
1228+
{
1229+
// Apparently returning None works.
1230+
Py_INCREF(Py_None);
1231+
return Py_None;
1232+
}
12251233
#else
12261234
static PyObject *
12271235
call_load_module(char *name, int len, PyObject *find_module_result)
@@ -1400,9 +1408,8 @@ static struct PyMethodDef VimMethods[] = {
14001408
{"foreach_rtp", VimForeachRTP, METH_O, "Call given callable for each path in &rtp"},
14011409
#if PY_VERSION_HEX >= 0x030700f0
14021410
{"find_spec", FinderFindSpec, METH_VARARGS, "Internal use only, returns spec object for any input it receives"},
1403-
#else
1404-
{"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"},
14051411
#endif
1412+
{"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"},
14061413
{"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"},
14071414
{"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"},
14081415
{ NULL, NULL, 0, NULL}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ static char *(features[]) =
767767

768768
static int included_patches[] =
769769
{ /* Add new patch number below this line */
770+
/**/
771+
1361,
770772
/**/
771773
1360,
772774
/**/

0 commit comments

Comments
 (0)