]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.907 v7.3.907
authorBram Moolenaar <Bram@vim.org>
Wed, 24 Apr 2013 11:04:26 +0000 (13:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 24 Apr 2013 11:04:26 +0000 (13:04 +0200)
Problem:    Python uses IndexError when a dict key is not found.
Solution:   Use KeyError instead. (ZyX)

src/if_py_both.h
src/if_python.c
src/if_python3.c
src/testdir/test86.ok
src/testdir/test87.ok
src/version.c

index f5617acfcfd14fe77f8ca23b36a43ae103ad88a2..cd80800415138a2f60d6c6c57fda013e583c601e 100644 (file)
@@ -861,7 +861,7 @@ DictionaryItem(PyObject *self, PyObject *keyObject)
 
     if (di == NULL)
     {
-       PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
+       PyErr_SetString(PyExc_KeyError, _("no such key in dictionary"));
        return NULL;
     }
 
index 89cb0334b0c33f5d07de4b91f54551ac213b7777..0f90c9903247fdb1db5b93fa9da9a9da5639e464 100644 (file)
@@ -348,12 +348,14 @@ static HINSTANCE hinstPython = 0; /* Instance of python.dll */
 /* Imported exception objects */
 static PyObject *imp_PyExc_AttributeError;
 static PyObject *imp_PyExc_IndexError;
+static PyObject *imp_PyExc_KeyError;
 static PyObject *imp_PyExc_KeyboardInterrupt;
 static PyObject *imp_PyExc_TypeError;
 static PyObject *imp_PyExc_ValueError;
 
 # define PyExc_AttributeError imp_PyExc_AttributeError
 # define PyExc_IndexError imp_PyExc_IndexError
+# define PyExc_KeyError imp_PyExc_KeyError
 # define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt
 # define PyExc_TypeError imp_PyExc_TypeError
 # define PyExc_ValueError imp_PyExc_ValueError
@@ -579,11 +581,13 @@ get_exceptions(void)
     PyObject *exdict = PyModule_GetDict(exmod);
     imp_PyExc_AttributeError = PyDict_GetItemString(exdict, "AttributeError");
     imp_PyExc_IndexError = PyDict_GetItemString(exdict, "IndexError");
+    imp_PyExc_KeyError = PyDict_GetItemString(exdict, "KeyError");
     imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
     imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
     imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
     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);
index d8f757475f589186ba7704cab7185a4892bab6dc..2a66cfada652ff192ba842eed527874e976a130a 100644 (file)
@@ -327,12 +327,14 @@ static HINSTANCE hinstPy3 = 0; /* Instance of python.dll */
 /* Imported exception objects */
 static PyObject *p3imp_PyExc_AttributeError;
 static PyObject *p3imp_PyExc_IndexError;
+static PyObject *p3imp_PyExc_KeyError;
 static PyObject *p3imp_PyExc_KeyboardInterrupt;
 static PyObject *p3imp_PyExc_TypeError;
 static PyObject *p3imp_PyExc_ValueError;
 
 # define PyExc_AttributeError p3imp_PyExc_AttributeError
 # define PyExc_IndexError p3imp_PyExc_IndexError
+# define PyExc_KeyError p3imp_PyExc_KeyError
 # define PyExc_KeyboardInterrupt p3imp_PyExc_KeyboardInterrupt
 # define PyExc_TypeError p3imp_PyExc_TypeError
 # define PyExc_ValueError p3imp_PyExc_ValueError
@@ -567,11 +569,13 @@ get_py3_exceptions()
     PyObject *exdict = PyModule_GetDict(exmod);
     p3imp_PyExc_AttributeError = PyDict_GetItemString(exdict, "AttributeError");
     p3imp_PyExc_IndexError = PyDict_GetItemString(exdict, "IndexError");
+    p3imp_PyExc_KeyError = PyDict_GetItemString(exdict, "KeyError");
     p3imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
     p3imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
     p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
     Py_XINCREF(p3imp_PyExc_AttributeError);
     Py_XINCREF(p3imp_PyExc_IndexError);
+    Py_XINCREF(p3imp_PyExc_KeyError);
     Py_XINCREF(p3imp_PyExc_KeyboardInterrupt);
     Py_XINCREF(p3imp_PyExc_TypeError);
     Py_XINCREF(p3imp_PyExc_ValueError);
index fd670c8463d7b20d67eb0bede418cf456e5406b4..20b00d4d0bd3ff1be3e459ae8a58b68817835ce9 100644 (file)
@@ -38,7 +38,7 @@ Vim(put):E684:
 Vim(python):E725:
 Vim(python):E117:
 [0.0, 0.0]
-IndexError
+KeyError
 TypeError
 TypeError
 ValueError
index b8769002ab9eb88a91cf186ea576fe66dfd75ec5..9d75c564e07fdc45ed00a5a95fe53d6aac1ef98d 100644 (file)
@@ -38,7 +38,7 @@ Vim(put):E684:
 Vim(py3):E725:
 Vim(py3):E117:
 [0.0, 0.0]
-IndexError
+KeyError
 TypeError
 TypeError
 ValueError
index a28cf6c31de0164b827176c24ea3f113e27c9e15..1aeeb5621aca5764e51cdcc4f457eb3d83702499 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    907,
 /**/
     906,
 /**/