diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-01-13 23:38:42 +0100 |
commit | f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (patch) | |
tree | a6b07005c19279a4f5d01be14f14861c2657fa95 /src/if_py_both.h | |
parent | 05500ece6282407f9f7227aaf564e24147326863 (diff) | |
download | vim-git-f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d.tar.gz |
patch 8.1.0743: giving error messages is not flexiblev8.1.0743
Problem: Giving error messages is not flexible.
Solution: Add semsg(). Change argument from "char_u *" to "char *", also
for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
#3302) Also make emsg() accept a "char *" argument. Get rid of
an enormous number of type casts.
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 0b8a3600e..165c84728 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -536,7 +536,7 @@ PythonIO_Init_io(void) if (PyErr_Occurred()) { - EMSG(_("E264: Python: Error initialising I/O objects")); + emsg(_("E264: Python: Error initialising I/O objects")); return -1; } @@ -5664,7 +5664,7 @@ run_cmd(const char *cmd, void *arg UNUSED } else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { - EMSG2(_(e_py_systemexit), "python"); + semsg(_(e_py_systemexit), "python"); PyErr_Clear(); } else @@ -5691,7 +5691,7 @@ run_do(const char *cmd, void *arg UNUSED if (u_save((linenr_T)RangeStart - 1, (linenr_T)RangeEnd + 1) != OK) { - EMSG(_("cannot save undo information")); + emsg(_("cannot save undo information")); return; } @@ -5709,7 +5709,7 @@ run_do(const char *cmd, void *arg UNUSED else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { PyMem_Free(code); - EMSG2(_(e_py_systemexit), "python"); + semsg(_(e_py_systemexit), "python"); PyErr_Clear(); return; } @@ -5720,7 +5720,7 @@ run_do(const char *cmd, void *arg UNUSED if (status) { - EMSG(_("failed to run the code")); + emsg(_("failed to run the code")); return; } @@ -5810,20 +5810,20 @@ run_eval(const char *cmd, typval_T *rettv { if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit)) { - EMSG2(_(e_py_systemexit), "python"); + semsg(_(e_py_systemexit), "python"); PyErr_Clear(); } else { if (PyErr_Occurred() && !msg_silent) PyErr_PrintEx(0); - EMSG(_("E858: Eval did not return a valid python object")); + emsg(_("E858: Eval did not return a valid python object")); } } else { if (ConvertFromPyObject(run_ret, rettv) == -1) - EMSG(_("E859: Failed to convert returned python object to vim value")); + emsg(_("E859: Failed to convert returned python object to vim value")); Py_DECREF(run_ret); } PyErr_Clear(); @@ -6727,7 +6727,7 @@ init_sys_path(void) else { VimTryStart(); - EMSG(_("Failed to set path hook: sys.path_hooks is not a list\n" + emsg(_("Failed to set path hook: sys.path_hooks is not a list\n" "You should now do the following:\n" "- append vim.path_hook to sys.path_hooks\n" "- append vim.VIM_SPECIAL_PATH to sys.path\n")); @@ -6757,7 +6757,7 @@ init_sys_path(void) else { VimTryStart(); - EMSG(_("Failed to set path: sys.path is not a list\n" + emsg(_("Failed to set path: sys.path is not a list\n" "You should now append vim.VIM_SPECIAL_PATH to sys.path")); VimTryEnd(); /* Discard the error */ } |