vim-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 vim/vim#4381)
7f3a28490a
This commit is contained in:
Jan Edmund Lazo 2019-12-31 23:15:42 -05:00
parent e922576bdd
commit 0301de758b
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
4 changed files with 32 additions and 0 deletions

View File

@ -164,3 +164,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

View File

@ -164,3 +164,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

View File

@ -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

View File

@ -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