0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.2187: Python 3 test fails sometimes

Problem:    Python 3 test fails sometimes. (Christian Brabandt)
Solution:   Accept two SystemError messages.
This commit is contained in:
Bram Moolenaar
2020-12-22 12:50:10 +01:00
parent 5b3d1bb0f5
commit 07761a3b96
2 changed files with 8 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ func Create_vim_dict()
return {'a': 1} return {'a': 1}
endfunction endfunction
let s:system_error_pat = 'Vim(py3):SystemError: \(<built-in function eval> returned NULL without setting an error\|error return without exception set\)'
" This function should be called first. This sets up python functions used by " This function should be called first. This sets up python functions used by
" the other tests. " the other tests.
@@ -539,11 +540,11 @@ endfunc
func Test_python3_list() func Test_python3_list()
" Try to convert a null List " Try to convert a null List
call AssertException(["py3 t = vim.eval('test_null_list()')"], call AssertException(["py3 t = vim.eval('test_null_list()')"],
\ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error') \ s:system_error_pat)
" Try to convert a List with a null List item " Try to convert a List with a null List item
call AssertException(["py3 t = vim.eval('[test_null_list()]')"], call AssertException(["py3 t = vim.eval('[test_null_list()]')"],
\ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error') \ s:system_error_pat)
" Try to bind a null List variable (works because an empty list is used) " Try to bind a null List variable (works because an empty list is used)
let cmds =<< trim END let cmds =<< trim END
@@ -582,11 +583,11 @@ endfunc
func Test_python3_dict() func Test_python3_dict()
" Try to convert a null Dict " Try to convert a null Dict
call AssertException(["py3 t = vim.eval('test_null_dict()')"], call AssertException(["py3 t = vim.eval('test_null_dict()')"],
\ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error') \ s:system_error_pat)
" Try to convert a Dict with a null List value " Try to convert a Dict with a null List value
call AssertException(["py3 t = vim.eval(\"{'a' : test_null_list()}\")"], call AssertException(["py3 t = vim.eval(\"{'a' : test_null_list()}\")"],
\ 'Vim(py3):SystemError: <built-in function eval> returned NULL without setting an error') \ s:system_error_pat)
" Try to convert a Dict with a null string key " Try to convert a Dict with a null string key
py3 t = vim.eval("{test_null_string() : 10}") py3 t = vim.eval("{test_null_string() : 10}")
@@ -1119,7 +1120,7 @@ func Test_python3_list_slice()
let l = [test_null_list()] let l = [test_null_list()]
py3 ll = vim.bindeval('l') py3 ll = vim.bindeval('l')
call AssertException(["py3 x = ll[:]"], call AssertException(["py3 x = ll[:]"],
\ "Vim(py3):SystemError: error return without exception set") \ s:system_error_pat)
endfunc endfunc
" Vars " Vars

View File

@@ -750,6 +750,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 */
/**/
2187,
/**/ /**/
2186, 2186,
/**/ /**/