This is the patch for the bug reported by Yggdroot Chen in vim_use mailing list 
(https://groups.google.com/forum/#!topic/vim_use/jR2lDzMPb9Y).

# HG changeset patch
# User ZyX <[email protected]>
# Date 1382108836 -14400
#      Fri Oct 18 19:07:16 2013 +0400
# Branch fix-py-vim-interrupt
# Node ID ce2b5adf52ff9b9ac37749e795d357d8b0a96f47
# Parent  92c9748e0ccbc42a5e28ce8fb9b8818e756a06da
Fix interrupt not being properly discarded in VimTryEnd

diff -r 92c9748e0ccb -r ce2b5adf52ff src/if_py_both.h
--- a/src/if_py_both.h  Sun Oct 06 17:46:56 2013 +0200
+++ b/src/if_py_both.h  Fri Oct 18 19:07:16 2013 +0400
@@ -558,7 +558,11 @@
     /* Keyboard interrupt should be preferred over anything else */
     if (got_int)
     {
-       did_throw = got_int = FALSE;
+       if (current_exception != NULL)
+           discard_current_exception();
+       else
+           need_rethrow = did_throw = FALSE;
+       got_int = FALSE;
        PyErr_SetNone(PyExc_KeyboardInterrupt);
        return -1;
     }
@@ -567,7 +571,10 @@
     /* Python exception is preferred over vim one; unlikely to occur though */
     else if (PyErr_Occurred())
     {
-       did_throw = FALSE;
+       if (current_exception != NULL)
+           discard_current_exception();
+       else
+           need_rethrow = did_throw = FALSE;
        return -1;
     }
     /* Finally transform VimL exception to python one */

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
*** /tmp/extdiff.FzK4b4/vim-small-patches.92c9748e0ccb/src/if_py_both.h	2013-10-18 19:09:40.282473540 +0400
--- vim-small-patches.ce2b5adf52ff/src/if_py_both.h	2013-10-18 19:09:40.287473367 +0400
***************
*** 558,564 ****
      /* Keyboard interrupt should be preferred over anything else */
      if (got_int)
      {
! 	did_throw = got_int = FALSE;
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
  	return -1;
      }
--- 558,568 ----
      /* Keyboard interrupt should be preferred over anything else */
      if (got_int)
      {
! 	if (current_exception != NULL)
! 	    discard_current_exception();
! 	else
! 	    need_rethrow = did_throw = FALSE;
! 	got_int = FALSE;
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
  	return -1;
      }
***************
*** 567,573 ****
      /* Python exception is preferred over vim one; unlikely to occur though */
      else if (PyErr_Occurred())
      {
! 	did_throw = FALSE;
  	return -1;
      }
      /* Finally transform VimL exception to python one */
--- 571,580 ----
      /* Python exception is preferred over vim one; unlikely to occur though */
      else if (PyErr_Occurred())
      {
! 	if (current_exception != NULL)
! 	    discard_current_exception();
! 	else
! 	    need_rethrow = did_throw = FALSE;
  	return -1;
      }
      /* Finally transform VimL exception to python one */

Raspunde prin e-mail lui