1
0
forked from aniani/vim

updated for version 7.3.1314

Problem:    Test 87 fails with Python 3.3.
Solution:   Filter the error messages. (Taro Muraoka)
This commit is contained in:
Bram Moolenaar
2013-07-06 13:54:33 +02:00
parent 254e028e90
commit 0d86e9b568
2 changed files with 15 additions and 0 deletions

View File

@@ -829,6 +829,10 @@ EOF
:fun D()
:endfun
py3 << EOF
import re
py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
def ee(expr, g=globals(), l=locals()):
try:
try:
@@ -836,6 +840,15 @@ def ee(expr, g=globals(), l=locals()):
except Exception as e:
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."):
cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
m = py33_type_error_pattern.search(str(e))
if m:
msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
else:
cb.append(expr + ':' + repr((e.__class__, e)))
else:
cb.append(expr + ':' + repr((e.__class__, e)))
else:

View File

@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1314,
/**/
1313,
/**/