From efc0d94afc48a03b07955e91315e7e67945cd079 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 11 Oct 2020 18:05:02 +0200 Subject: patch 8.2.1834: PyEval_InitThreads() is deprecated in Python 3.9 Problem: PyEval_InitThreads() is deprecated in Python 3.9. Solution: Do not call PyEval_InitThreads in Python 3.9 and later. (Ken Takata, closes #7113) Avoid warnings for functions. --- src/if_py_both.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/if_py_both.h') diff --git a/src/if_py_both.h b/src/if_py_both.h index 86942b686..36dedaf2d 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -307,7 +307,7 @@ ObjectDir(PyObject *self, char **attributes) // Output buffer management // Function to write a line, points to either msg() or emsg(). -typedef void (*writefn)(char_u *); +typedef int (*writefn)(char *); static PyTypeObject OutputType; @@ -359,8 +359,8 @@ PythonIO_Flush(void) { if (old_fn != NULL && io_ga.ga_len > 0) { - ((char_u *)io_ga.ga_data)[io_ga.ga_len] = NUL; - old_fn((char_u *)io_ga.ga_data); + ((char *)io_ga.ga_data)[io_ga.ga_len] = NUL; + old_fn((char *)io_ga.ga_data); } io_ga.ga_len = 0; } @@ -390,7 +390,7 @@ writer(writefn fn, char_u *str, PyInt n) mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)len); ((char *)io_ga.ga_data)[io_ga.ga_len + len] = NUL; - fn((char_u *)io_ga.ga_data); + fn((char *)io_ga.ga_data); str = ptr + 1; n -= len + 1; io_ga.ga_len = 0; -- cgit v1.2.1