# HG changeset patch # User Christian Brabandt # Date 1473426008 -7200 # Node ID 32dd27cceadddc4367dac43203e19b85d5446bd3 # Parent 0ccc6c45ff5b9be2d4cb8b15fe7d9442a3979063 commit https://github.com/vim/vim/commit/cf703fe9d66744ffd7d9c625ee1cbe048ee07740 Author: Bram Moolenaar Date: Fri Sep 9 14:59:39 2016 +0200 patch 7.4.2350 Problem: Test 86 and 87 fail with some version of Python. Solution: Unify "can't" and "cannot". Unify quotes. diff --git a/src/testdir/test86.in b/src/testdir/test86.in --- a/src/testdir/test86.in +++ b/src/testdir/test86.in @@ -239,6 +239,14 @@ def ee(expr, g=globals(), l=locals()): 'TypeError:("\'FailingNumber\' object is not iterable",)') if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1: msg = msg.replace('(\'', '("').replace('\',)', '",)') + # 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\'') if expr == 'fd(self=[])': # HACK: PyMapping_Check changed meaning msg = msg.replace('AttributeError:(\'keys\',)', diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -628,7 +628,7 @@ testdir test86.in > Output >> OutputSetattr -del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) +del sys.stdout.softspace:AttributeError:('cannot delete OutputObject attributes',) >>> Testing NumberToLong using sys.stdout.softspace = %s sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) sys.stdout.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) diff --git a/src/testdir/test87.in b/src/testdir/test87.in --- 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: diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -628,7 +628,7 @@ b'testdir' test87.in > Output >> OutputSetattr -del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +del sys.stdout.softspace:(, AttributeError('cannot delete OutputObject attributes',)) >>> Testing NumberToLong using sys.stdout.softspace = %s sys.stdout.softspace = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) sys.stdout.softspace = None:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2350, +/**/ 2349, /**/ 2348,