Skip to content

Commit 6cb9959

Browse files
ychinchrisbra
authored andcommitted
patch 9.1.1869: tests: test failures with Python 3.14 and test_python3
Problem: tests: test failures with Python 3.14 and test_python3 Solution: Adjust the expected error message (Yee Cheng Chin) Python 3.14 changed the error message from "argument must be 2-item sequence" to "argument must be 2-item tuple". Fix test to account for that. Otherwise the error message for the `vim.current.window.cursor = True` line would not match. closes: #18629 Signed-off-by: Yee Cheng Chin <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 0124320 commit 6cb9959

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/testdir/test_python3.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func Test_AAA_python3_setup()
2828
py37_exception_repr = re.compile(r'([^\(\),])(\)+)$')
2929
py39_type_error_pattern = re.compile(r'\w+\.([^(]+\(\) takes)')
3030
py310_type_error_pattern = re.compile(r'takes (\d+) positional argument but (\d+) were given')
31+
py314_type_error_tuple_pattern = re.compile(r'must be (\d+)-item tuple')
3132

3233
def emsg(ei):
3334
return ei[0].__name__ + ':' + repr(ei[1].args)
@@ -64,6 +65,8 @@ func Test_AAA_python3_setup()
6465
# Python 3.9 reports errors like "vim.command() takes ..." instead of "command() takes ..."
6566
msg = py39_type_error_pattern.sub(r'\1', msg)
6667
msg = py310_type_error_pattern.sub(r'takes exactly \1 positional argument (\2 given)', msg)
68+
# Python 3.14 has specific error messages for Tuple's
69+
msg = py314_type_error_tuple_pattern.sub(r'must be \1-item sequence', msg)
6770
elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
6871
msg = repr((TypeError, TypeError('expected bytes with no null')))
6972
else:

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
1869,
737739
/**/
738740
1868,
739741
/**/

0 commit comments

Comments
 (0)