mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.1346: error for Python exception does not show useful info
Problem: Error for Python exception does not show useful info. Solution: Show the last line instead of the first one. (Ben Jackson, closes #4381)
This commit is contained in:
@@ -412,6 +412,8 @@ write_output(OutputObject *self, PyObject *string)
|
|||||||
|
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
Python_Lock_Vim();
|
Python_Lock_Vim();
|
||||||
|
if (error)
|
||||||
|
emsg_severe = TRUE;
|
||||||
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
|
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
|
||||||
Python_Release_Vim();
|
Python_Release_Vim();
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
@@ -91,7 +91,7 @@ pyeval("None") = v:none
|
|||||||
0.0
|
0.0
|
||||||
"\0": Vim(let):E859:
|
"\0": Vim(let):E859:
|
||||||
{"\0": 1}: Vim(let):E859:
|
{"\0": 1}: Vim(let):E859:
|
||||||
undefined_name: Vim(let):Trace
|
undefined_name: Vim(let):NameE
|
||||||
vim: Vim(let):E859:
|
vim: Vim(let):E859:
|
||||||
[1]
|
[1]
|
||||||
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
|
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
|
||||||
|
@@ -91,7 +91,7 @@ py3eval("None") = v:none
|
|||||||
0.0
|
0.0
|
||||||
"\0": Vim(let):E859:
|
"\0": Vim(let):E859:
|
||||||
{"\0": 1}: Vim(let):E859:
|
{"\0": 1}: Vim(let):E859:
|
||||||
undefined_name: Vim(let):Trace
|
undefined_name: Vim(let):NameE
|
||||||
vim: Vim(let):E859:
|
vim: Vim(let):E859:
|
||||||
[1]
|
[1]
|
||||||
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
|
[1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1]
|
||||||
|
@@ -160,3 +160,11 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str()
|
|||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
func Test_Catch_Exception_Message()
|
||||||
|
try
|
||||||
|
py raise RuntimeError( 'TEST' )
|
||||||
|
catch /.*/
|
||||||
|
call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
@@ -160,3 +160,11 @@ func Test_Write_To_Current_Buffer_Fixes_Cursor_Str()
|
|||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
func Test_Catch_Exception_Message()
|
||||||
|
try
|
||||||
|
py3 raise RuntimeError( 'TEST' )
|
||||||
|
catch /.*/
|
||||||
|
call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
@@ -72,3 +72,11 @@ func Test_pyxfile()
|
|||||||
call assert_match(s:py3pattern, split(var)[0])
|
call assert_match(s:py3pattern, split(var)[0])
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_Catch_Exception_Message()
|
||||||
|
try
|
||||||
|
pyx raise RuntimeError( 'TEST' )
|
||||||
|
catch /.*/
|
||||||
|
call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
@@ -72,3 +72,11 @@ func Test_pyxfile()
|
|||||||
call assert_match(s:py2pattern, split(var)[0])
|
call assert_match(s:py2pattern, split(var)[0])
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_Catch_Exception_Message()
|
||||||
|
try
|
||||||
|
pyx raise RuntimeError( 'TEST' )
|
||||||
|
catch /.*/
|
||||||
|
call assert_match( '^Vim(.*):RuntimeError: TEST$', v:exception )
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
@@ -767,6 +767,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1346,
|
||||||
/**/
|
/**/
|
||||||
1345,
|
1345,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user