Skip to content

Commit 2e4361b

Browse files
committed
patch 9.1.1092: tests: fix expected return code for python 3.13 on Windows
Problem: tests: fix expected return code for python 3.13 on Windows Solution: Check for return code 1 or 123 on Windows There is a regression with python 3.13 on Windows, that it no longer prints the requested error code, but instead exits with return code 1, which breaks the test-suite. So let's check for either exit code 1 or 123 in tests Test_terminal_duplicate_eof_arg() and Test_terminal_eof_arg() This will probably be fixed on the Python side, see the pull request python/cpython#129901 but in the meantime, let's allow both error codes. related: #16599 related: python/cpython#129900 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent ec7a4e4 commit 2e4361b

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/testdir/test_terminal.vim

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,15 @@ func Test_terminal_eof_arg()
944944
call WaitFor({-> getline('$') =~ 'hello'})
945945
call assert_equal('hello', getline('$'))
946946
endif
947-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
947+
let exitval = bufnr()->term_getjob()->job_info().exitval
948+
if !has('win32')
949+
call assert_equal(123, exitval)
950+
else
951+
" python 3.13 on Windows returns exit code 1
952+
" older versions returned correctly exit code 123
953+
" https://github.com/python/cpython/issues/129900
954+
call assert_match('1\|123', exitval)
955+
endif
948956
%bwipe!
949957
endfunc
950958

@@ -976,7 +984,15 @@ func Test_terminal_duplicate_eof_arg()
976984
call WaitFor({-> getline('$') =~ 'hello'})
977985
call assert_equal('hello', getline('$'))
978986
endif
979-
call assert_equal(123, bufnr()->term_getjob()->job_info().exitval)
987+
let exitval = bufnr()->term_getjob()->job_info().exitval
988+
if !has('win32')
989+
call assert_equal(123, exitval)
990+
else
991+
" python 3.13 on Windows returns exit code 1
992+
" older versions returned correctly exit code 123
993+
" https://github.com/python/cpython/issues/129900
994+
call assert_match('1\|123', exitval)
995+
endif
980996
%bwipe!
981997
endfunc
982998

src/version.c

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

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1092,
707709
/**/
708710
1091,
709711
/**/

0 commit comments

Comments
 (0)