]> granicus.if.org Git - vim/commitdiff
patch 8.2.3602: Python3 test fails with Python 3.10 on MS-Windows v8.2.3602
authorK.Takata <kentkt@csc.jp>
Tue, 16 Nov 2021 13:08:56 +0000 (13:08 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 16 Nov 2021 13:08:56 +0000 (13:08 +0000)
Problem:    Python3 test fails with Python 3.10 on MS-Windows.
Solution:   Adjust the expected error. (Ken Takata, closes #9118)

src/testdir/test_python3.vim
src/version.c

index ed053094f8e026e0c935af7f4f32ec178d328562..b2168774311e1e5f335dc897733d3191904184ab 100644 (file)
@@ -25,6 +25,7 @@ func Test_AAA_python3_setup()
     py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
     py37_exception_repr = re.compile(r'([^\(\),])(\)+)$')
     py39_type_error_pattern = re.compile('\w+\.([^(]+\(\) takes)')
+    py310_type_error_pattern = re.compile('takes (\d+) positional argument but (\d+) were given')
 
     def emsg(ei):
       return ei[0].__name__ + ':' + repr(ei[1].args)
@@ -60,6 +61,7 @@ func Test_AAA_python3_setup()
                             msg = msg.replace(newmsg2, oldmsg2)
                         # Python 3.9 reports errors like "vim.command() takes ..." instead of "command() takes ..."
                         msg = py39_type_error_pattern.sub(r'\1', msg)
+                        msg = py310_type_error_pattern.sub(r'takes exactly \1 positional argument (\2 given)', msg)
                 elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
                     msg = repr((TypeError, TypeError('expected bytes with no null')))
                 else:
@@ -2639,6 +2641,7 @@ func Test_python3_errors()
   py3 cb = vim.current.buffer
 
   py3 << trim EOF
+    import os
     d = vim.Dictionary()
     ned = vim.Dictionary(foo='bar', baz='abcD')
     dl = vim.Dictionary(a=1)
index 3227bb605986b5d5d929dd5b13cebf4eb979eed6..5d3d2a36aa9d59e23ae42a9e61f0e3edb39c8726 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3602,
 /**/
     3601,
 /**/