comparison src/if_py_both.h @ 5469:a56f60cf6834 v7.4.084

updated for version 7.4.084 Problem: Python: interrupt not being properly discarded. (Yggdroot Chen) Solution: Discard interrupt in VimTryEnd. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Mon, 11 Nov 2013 01:05:48 +0100
parents 9cedb4dfd4c8
children 064e2a080e2e
comparison
equal deleted inserted replaced
5468:f376ec8e037e 5469:a56f60cf6834
556 * cycle */ 556 * cycle */
557 did_emsg = FALSE; 557 did_emsg = FALSE;
558 /* Keyboard interrupt should be preferred over anything else */ 558 /* Keyboard interrupt should be preferred over anything else */
559 if (got_int) 559 if (got_int)
560 { 560 {
561 did_throw = got_int = FALSE; 561 if (current_exception != NULL)
562 discard_current_exception();
563 else
564 need_rethrow = did_throw = FALSE;
565 got_int = FALSE;
562 PyErr_SetNone(PyExc_KeyboardInterrupt); 566 PyErr_SetNone(PyExc_KeyboardInterrupt);
563 return -1; 567 return -1;
564 } 568 }
565 else if (!did_throw) 569 else if (!did_throw)
566 return (PyErr_Occurred() ? -1 : 0); 570 return (PyErr_Occurred() ? -1 : 0);
567 /* Python exception is preferred over vim one; unlikely to occur though */ 571 /* Python exception is preferred over vim one; unlikely to occur though */
568 else if (PyErr_Occurred()) 572 else if (PyErr_Occurred())
569 { 573 {
570 did_throw = FALSE; 574 if (current_exception != NULL)
575 discard_current_exception();
576 else
577 need_rethrow = did_throw = FALSE;
571 return -1; 578 return -1;
572 } 579 }
573 /* Finally transform VimL exception to python one */ 580 /* Finally transform VimL exception to python one */
574 else 581 else
575 { 582 {