summaryrefslogtreecommitdiffstats
path: root/src/testdir/test87.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-09 14:59:39 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-09 14:59:39 +0200
commitcf703fe9d66744ffd7d9c625ee1cbe048ee07740 (patch)
tree5042b79834702f9c4c48c118596385474c1153be /src/testdir/test87.in
parent2321ca2a78286bc026fa7f407281ddbeb04114bb (diff)
patch 7.4.2350v7.4.2350
Problem: Test 86 and 87 fail with some version of Python. Solution: Unify "can't" and "cannot". Unify quotes.
Diffstat (limited to 'src/testdir/test87.in')
-rw-r--r--src/testdir/test87.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index e75cd27a3a..0db3a27730 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -238,9 +238,18 @@ def ee(expr, g=globals(), l=locals()):
else:
cb.append(expr + ':' + repr((e.__class__, e)))
elif sys.version_info >= (3, 5) and e.__class__ is ValueError and str(e) == 'embedded null byte':
- msg = cb.append(expr + ':' + repr((TypeError, TypeError('expected bytes with no null'))))
+ cb.append(expr + ':' + repr((TypeError, TypeError('expected bytes with no null'))))
else:
- cb.append(expr + ':' + repr((e.__class__, e)))
+ msg = repr((e.__class__, e))
+ # Some Python versions say can't, others cannot.
+ if msg.find('can\'t') > -1:
+ msg = msg.replace('can\'t', 'cannot')
+ # Some Python versions use single quote, some double quote
+ if msg.find('"cannot ') > -1:
+ msg = msg.replace('"cannot ', '\'cannot ')
+ if msg.find(' attributes"') > -1:
+ msg = msg.replace(' attributes"', ' attributes\'')
+ cb.append(expr + ':' + msg)
else:
cb.append(expr + ':NOT FAILED')
except Exception as e: