diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:35:09 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-15 15:35:09 +0200 |
commit | 4d188da22bc42b58ed66746c8d6235616214e55f (patch) | |
tree | e8c93bef490ad575b47925682fc16a1b46a34855 /src/if_py_both.h | |
parent | 5e538ecd5e68b90f630be7bb177ab64e1285e40b (diff) | |
download | vim-4d188da22bc42b58ed66746c8d6235616214e55f.zip |
updated for version 7.3.950
Problem: Python: Stack trace printer can't handle messages.
Solution: Make KeyErrors use PyErr_SetObject. (ZyX)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index b80a3e24a..285054030 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -734,7 +734,7 @@ DictionaryItem(PyObject *self, PyObject *keyObject) if (di == NULL) { - PyErr_SetString(PyExc_KeyError, _("no such key in dictionary")); + PyErr_SetObject(PyExc_KeyError, keyObject); return NULL; } @@ -767,7 +767,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject) if (di == NULL) { DICTKEY_UNREF - PyErr_SetString(PyExc_IndexError, _("no such key in dictionary")); + PyErr_SetObject(PyExc_KeyError, keyObject); return -1; } hi = hash_find(&d->dv_hashtab, di->di_key); @@ -1353,7 +1353,7 @@ OptionsItem(OptionsObject *this, PyObject *keyObject) if (flags == 0) { - PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope"); + PyErr_SetObject(PyExc_KeyError, keyObject); return NULL; } @@ -1447,7 +1447,7 @@ OptionsAssItem(OptionsObject *this, PyObject *keyObject, PyObject *valObject) if (flags == 0) { - PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope"); + PyErr_SetObject(PyExc_KeyError, keyObject); return -1; } @@ -3145,7 +3145,7 @@ BufMapItem(PyObject *self UNUSED, PyObject *keyObject) return BufferNew(b); else { - PyErr_SetString(PyExc_KeyError, _("no such buffer")); + PyErr_SetObject(PyExc_KeyError, keyObject); return NULL; } } |