Skip to content

Commit bceebe0

Browse files
committed
updated for version 7.3.1314
Problem: Test 87 fails with Python 3.3. Solution: Filter the error messages. (Taro Muraoka)
1 parent f54f0a2 commit bceebe0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/testdir/test87.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,26 @@ EOF
829829
:fun D()
830830
:endfun
831831
py3 << EOF
832+
import re
833+
834+
py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
835+
832836
def ee(expr, g=globals(), l=locals()):
833837
try:
834838
try:
835839
exec(expr, g, l)
836840
except Exception as e:
837841
if sys.version_info >= (3, 3) and e.__class__ is AttributeError and str(e).find('has no attribute')>=0 and not str(e).startswith("'vim."):
838842
cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
843+
elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
844+
cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
845+
elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
846+
m = py33_type_error_pattern.search(str(e))
847+
if m:
848+
msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
849+
cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
850+
else:
851+
cb.append(expr + ':' + repr((e.__class__, e)))
839852
else:
840853
cb.append(expr + ':' + repr((e.__class__, e)))
841854
else:

src/version.c

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

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
1314,
731733
/**/
732734
1313,
733735
/**/

0 commit comments

Comments
 (0)