Hi mattn,

2013/07/02 Tue 5:03:19 UTC+9 Bram Moolenaar wrote:
> Patch 7.3.1287
> Problem:    Python SystemExit exception is not handled properly.
> Solution:   Catch the exception and give an error. (Yasuhiro Matsumoto, Ken
>           Takata)
> Files:            runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c,
>           src/if_python3.c

    (snip)

> --- 5100,5113 ----
>   {
>       PyObject        *run_ret;
>   
> !     run_ret = PyRun_String((char *)cmd, Py_eval_input, globals, globals);
>       if (run_ret == NULL)
>       {
> +     if (PyErr_ExceptionMatches(PyExc_SystemExit))
> +     {
> +         EMSG2(_(e_py_systemexit), "python");
> +         PyErr_Clear();
> +     }
>       if (PyErr_Occurred() && !msg_silent)
>           PyErr_PrintEx(0);
>       EMSG(_("E858: Eval did not return a valid python object"));

I think this part has some problems. When a SystemExit exception occur,
E880 and E858 will be shown but showing E858 may not be necessary.
I also think it's better to call PyErr_Occurred() before calling
PyErr_ExceptionMatches(). Here is a patch:
https://bitbucket.org/k_takata/vim-win32-mq/src/a449bd5ecf4c4af791231cb4fb2597e58ea97da9/python-run_eval.patch

Thanks,
Ken Takata

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui