]> granicus.if.org Git - vim/commitdiff
patch 8.1.1361: Python setuptools don't work with Python 3 v8.1.1361
authorBram Moolenaar <Bram@vim.org>
Mon, 20 May 2019 19:52:45 +0000 (21:52 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 20 May 2019 19:52:45 +0000 (21:52 +0200)
Problem:    Python setuptools don't work with Python 3.
Solution:   Add dummy implementation for find_module. (Joel Frederico,
            closes #4402, closes #3984

src/if_py_both.h
src/version.c

index cc0450c13b599798ccce569d42296fb41ada5ea7..e36f4fdee3cbdc279fe0f994e6b99c2e678ac0db 100644 (file)
@@ -1222,6 +1222,14 @@ FinderFindSpec(PyObject *self, PyObject *args)
 
     return spec;
 }
+
+    static PyObject *
+FinderFindModule(PyObject* self UNUSED, PyObject* args UNUSED)
+{
+    // Apparently returning None works.
+    Py_INCREF(Py_None);
+    return Py_None;
+}
 #else
     static PyObject *
 call_load_module(char *name, int len, PyObject *find_module_result)
@@ -1400,9 +1408,8 @@ static struct PyMethodDef VimMethods[] = {
     {"foreach_rtp", VimForeachRTP,             METH_O,                         "Call given callable for each path in &rtp"},
 #if PY_VERSION_HEX >= 0x030700f0
     {"find_spec",   FinderFindSpec,            METH_VARARGS,                   "Internal use only, returns spec object for any input it receives"},
-#else
-    {"find_module", FinderFindModule,          METH_VARARGS,                   "Internal use only, returns loader object for any input it receives"},
 #endif
+    {"find_module", FinderFindModule,          METH_VARARGS,                   "Internal use only, returns loader object for any input it receives"},
     {"path_hook",   VimPathHook,               METH_VARARGS,                   "Hook function to install in sys.path_hooks"},
     {"_get_paths",  (PyCFunction)Vim_GetPaths, METH_NOARGS,                    "Get &rtp-based additions to sys.path"},
     { NULL,        NULL,                       0,                              NULL}
index 01a0b0d6223024642eadc44b574e6e7aceac405f..de5ffc6e64333f847408000d36004e8b99b454a8 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1361,
 /**/
     1360,
 /**/