073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.161
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.161
073263
Problem:    Crash in Python exception handling.
073263
Solution:   Only use exception variables if did_throw is set. (ZyX)
073263
Files:	    if_py_both.h
073263
073263
073263
*** ../vim-7.4.160/src/if_py_both.h	2014-01-14 19:35:49.000000000 +0100
073263
--- src/if_py_both.h	2014-01-31 14:46:20.455526607 +0100
073263
***************
073263
*** 564,573 ****
073263
      /* Keyboard interrupt should be preferred over anything else */
073263
      if (got_int)
073263
      {
073263
! 	if (current_exception != NULL)
073263
  	    discard_current_exception();
073263
- 	else
073263
- 	    need_rethrow = did_throw = FALSE;
073263
  	got_int = FALSE;
073263
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
073263
  	return -1;
073263
--- 564,571 ----
073263
      /* Keyboard interrupt should be preferred over anything else */
073263
      if (got_int)
073263
      {
073263
! 	if (did_throw)
073263
  	    discard_current_exception();
073263
  	got_int = FALSE;
073263
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
073263
  	return -1;
073263
***************
073263
*** 599,608 ****
073263
      /* Python exception is preferred over vim one; unlikely to occur though */
073263
      else if (PyErr_Occurred())
073263
      {
073263
! 	if (current_exception != NULL)
073263
! 	    discard_current_exception();
073263
! 	else
073263
! 	    need_rethrow = did_throw = FALSE;
073263
  	return -1;
073263
      }
073263
      /* Finally transform VimL exception to python one */
073263
--- 597,603 ----
073263
      /* Python exception is preferred over vim one; unlikely to occur though */
073263
      else if (PyErr_Occurred())
073263
      {
073263
! 	discard_current_exception();
073263
  	return -1;
073263
      }
073263
      /* Finally transform VimL exception to python one */
073263
*** ../vim-7.4.160/src/version.c	2014-01-24 19:55:33.078220735 +0100
073263
--- src/version.c	2014-01-31 14:46:39.127526894 +0100
073263
***************
073263
*** 740,741 ****
073263
--- 740,743 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     161,
073263
  /**/
073263
073263
-- 
073263
Eagles may soar, but weasels don't get sucked into jet engines.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///