summaryrefslogtreecommitdiff
path: root/src/testdir/test87.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-06 13:54:33 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-06 13:54:33 +0200
commit0d86e9b568df3ec4f3e44dfa60e328b2e48bffaf (patch)
treedcb8f7739be59e7a1ace4f73e517e1de9ac21870 /src/testdir/test87.in
parent254e028e907d8f261f8911242eb0ca5d04276b93 (diff)
downloadvim-0d86e9b568df3ec4f3e44dfa60e328b2e48bffaf.zip
updated for version 7.3.1314
Problem: Test 87 fails with Python 3.3. Solution: Filter the error messages. (Taro Muraoka)
Diffstat (limited to 'src/testdir/test87.in')
-rw-r--r--src/testdir/test87.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 89b0ecb06..0ee6df3b2 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -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: