diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:44:28 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:44:28 +0200 |
commit | 8661b17843d95866dedfa0f4fbfec2278ee010be (patch) | |
tree | e0de67a475e37adf3254859a9b3e870970ce50ec /src/if_python.c | |
parent | 4d188da22bc42b58ed66746c8d6235616214e55f (diff) | |
download | vim-git-8661b17843d95866dedfa0f4fbfec2278ee010be.tar.gz |
updated for version 7.3.951v7.3.951
Problem: Python exceptions have problems.
Solution: Change some IndexErrors to TypeErrors. Make “line number out of
range” an IndexError. Make “unable to get option value” a
RuntimeError. Make all PyErr_SetString messages start with
lowercase letter and use _(). (ZyX)
Diffstat (limited to 'src/if_python.c')
-rw-r--r-- | src/if_python.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/if_python.c b/src/if_python.c index edbba2133..8a459fd43 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -358,6 +358,7 @@ static PyObject *imp_PyExc_KeyError; static PyObject *imp_PyExc_KeyboardInterrupt; static PyObject *imp_PyExc_TypeError; static PyObject *imp_PyExc_ValueError; +static PyObject *imp_PyExc_RuntimeError; # define PyExc_AttributeError imp_PyExc_AttributeError # define PyExc_IndexError imp_PyExc_IndexError @@ -365,6 +366,7 @@ static PyObject *imp_PyExc_ValueError; # define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt # define PyExc_TypeError imp_PyExc_TypeError # define PyExc_ValueError imp_PyExc_ValueError +# define PyExc_RuntimeError imp_PyExc_RuntimeError /* * Table of name to function pointer of python. @@ -593,12 +595,14 @@ get_exceptions(void) imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt"); imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError"); imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError"); Py_XINCREF(imp_PyExc_AttributeError); Py_XINCREF(imp_PyExc_IndexError); Py_XINCREF(imp_PyExc_KeyError); Py_XINCREF(imp_PyExc_KeyboardInterrupt); Py_XINCREF(imp_PyExc_TypeError); Py_XINCREF(imp_PyExc_ValueError); + Py_XINCREF(imp_PyExc_RuntimeError); Py_XDECREF(exmod); } #endif /* DYNAMIC_PYTHON */ |