Karsten Hopp 18a3aa
To: vim_dev@googlegroups.com
Karsten Hopp 18a3aa
Subject: Patch 7.3.953
Karsten Hopp 18a3aa
Fcc: outbox
Karsten Hopp 18a3aa
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 18a3aa
Mime-Version: 1.0
Karsten Hopp 18a3aa
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 18a3aa
Content-Transfer-Encoding: 8bit
Karsten Hopp 18a3aa
------------
Karsten Hopp 18a3aa
Karsten Hopp 18a3aa
Patch 7.3.953
Karsten Hopp 18a3aa
Problem:    Python: string exceptions are deprecated.
Karsten Hopp 18a3aa
Solution:   Make vim.error an Exception subclass. (ZyX)
Karsten Hopp 18a3aa
Files:	    src/if_python.c, src/if_python3.c
Karsten Hopp 18a3aa
Karsten Hopp 18a3aa
Karsten Hopp 18a3aa
*** ../vim-7.3.952/src/if_python.c	2013-05-15 15:44:24.000000000 +0200
Karsten Hopp 18a3aa
--- src/if_python.c	2013-05-15 16:02:20.000000000 +0200
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 149,154 ****
Karsten Hopp 18a3aa
--- 149,155 ----
Karsten Hopp 18a3aa
  # define PyMem_Malloc dll_PyMem_Malloc
Karsten Hopp 18a3aa
  # define PyDict_SetItemString dll_PyDict_SetItemString
Karsten Hopp 18a3aa
  # define PyErr_BadArgument dll_PyErr_BadArgument
Karsten Hopp 18a3aa
+ # define PyErr_NewException dll_PyErr_NewException
Karsten Hopp 18a3aa
  # define PyErr_Clear dll_PyErr_Clear
Karsten Hopp 18a3aa
  # define PyErr_PrintEx dll_PyErr_PrintEx
Karsten Hopp 18a3aa
  # define PyErr_NoMemory dll_PyErr_NoMemory
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 255,260 ****
Karsten Hopp 18a3aa
--- 256,262 ----
Karsten Hopp 18a3aa
  static void* (*dll_PyMem_Malloc)(size_t);
Karsten Hopp 18a3aa
  static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
Karsten Hopp 18a3aa
  static int(*dll_PyErr_BadArgument)(void);
Karsten Hopp 18a3aa
+ static PyObject *(*dll_PyErr_NewException)(char *, PyObject *, PyObject *);
Karsten Hopp 18a3aa
  static void(*dll_PyErr_Clear)(void);
Karsten Hopp 18a3aa
  static void(*dll_PyErr_PrintEx)(int);
Karsten Hopp 18a3aa
  static PyObject*(*dll_PyErr_NoMemory)(void);
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 391,396 ****
Karsten Hopp 18a3aa
--- 393,399 ----
Karsten Hopp 18a3aa
      {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
Karsten Hopp 18a3aa
      {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
Karsten Hopp 18a3aa
      {"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument},
Karsten Hopp 18a3aa
+     {"PyErr_NewException", (PYTHON_PROC*)&dll_PyErr_NewException},
Karsten Hopp 18a3aa
      {"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear},
Karsten Hopp 18a3aa
      {"PyErr_PrintEx", (PYTHON_PROC*)&dll_PyErr_PrintEx},
Karsten Hopp 18a3aa
      {"PyErr_NoMemory", (PYTHON_PROC*)&dll_PyErr_NoMemory},
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 1304,1310 ****
Karsten Hopp 18a3aa
      mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION);
Karsten Hopp 18a3aa
      dict = PyModule_GetDict(mod);
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
!     VimError = Py_BuildValue("s", "vim.error");
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
      PyDict_SetItemString(dict, "error", VimError);
Karsten Hopp 18a3aa
      PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
--- 1307,1313 ----
Karsten Hopp 18a3aa
      mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION);
Karsten Hopp 18a3aa
      dict = PyModule_GetDict(mod);
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
!     VimError = PyErr_NewException("vim.error", NULL, NULL);
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
      PyDict_SetItemString(dict, "error", VimError);
Karsten Hopp 18a3aa
      PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
*** ../vim-7.3.952/src/if_python3.c	2013-05-15 15:44:24.000000000 +0200
Karsten Hopp 18a3aa
--- src/if_python3.c	2013-05-15 16:02:20.000000000 +0200
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 1606,1613 ****
Karsten Hopp 18a3aa
  	return NULL;
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
      VimError = PyErr_NewException("vim.error", NULL, NULL);
Karsten Hopp 18a3aa
-     Py_INCREF(VimError);
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
      PyModule_AddObject(mod, "error", VimError);
Karsten Hopp 18a3aa
      Py_INCREF((PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
      PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
--- 1606,1613 ----
Karsten Hopp 18a3aa
  	return NULL;
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
      VimError = PyErr_NewException("vim.error", NULL, NULL);
Karsten Hopp 18a3aa
  
Karsten Hopp 18a3aa
+     Py_INCREF(VimError);
Karsten Hopp 18a3aa
      PyModule_AddObject(mod, "error", VimError);
Karsten Hopp 18a3aa
      Py_INCREF((PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
      PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
Karsten Hopp 18a3aa
*** ../vim-7.3.952/src/version.c	2013-05-15 15:51:03.000000000 +0200
Karsten Hopp 18a3aa
--- src/version.c	2013-05-15 16:02:43.000000000 +0200
Karsten Hopp 18a3aa
***************
Karsten Hopp 18a3aa
*** 730,731 ****
Karsten Hopp 18a3aa
--- 730,733 ----
Karsten Hopp 18a3aa
  {   /* Add new patch number below this line */
Karsten Hopp 18a3aa
+ /**/
Karsten Hopp 18a3aa
+     953,
Karsten Hopp 18a3aa
  /**/
Karsten Hopp 18a3aa
Karsten Hopp 18a3aa
-- 
Karsten Hopp 18a3aa
The early bird gets the worm. If you want something else for
Karsten Hopp 18a3aa
breakfast, get up later.
Karsten Hopp 18a3aa
Karsten Hopp 18a3aa
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 18a3aa
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 18a3aa
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 18a3aa
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///