]> granicus.if.org Git - vim/commitdiff
patch 7.4.2350 v7.4.2350
authorBram Moolenaar <Bram@vim.org>
Fri, 9 Sep 2016 12:59:39 +0000 (14:59 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 9 Sep 2016 12:59:39 +0000 (14:59 +0200)
Problem:    Test 86 and 87 fail with some version of Python.
Solution:   Unify "can't" and "cannot".  Unify quotes.

src/testdir/test86.in
src/testdir/test86.ok
src/testdir/test87.in
src/testdir/test87.ok
src/version.c

index bf7b3d31c73644d987c8c11dcfe05d92c944edf5..71dd9f1fd8c150cab73afcab3fb3e57be2efd551 100644 (file)
@@ -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\',)',
index 6d561ecd1cec5376e8927b4b59ff401096373171..4e6c4e0a69649ffa58f1ae8cff678f24fadc7761 100644 (file)
@@ -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',)
index e75cd27a3a4951ca8892042b5c97f478af3f441d..0db3a277303d4983c99d6c34e560b29137ada3ef 100644 (file)
@@ -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:
index 34e9279633eb717960975e3ff3fc7ab810e8131f..d90ef86254604c8cf664749184cf1c0df5ea9b3b 100644 (file)
@@ -628,7 +628,7 @@ b'testdir'
 test87.in
 > Output
 >> OutputSetattr
-del sys.stdout.softspace:(<class 'AttributeError'>, AttributeError("can't delete OutputObject attributes",))
+del sys.stdout.softspace:(<class 'AttributeError'>, AttributeError('cannot delete OutputObject attributes',))
 >>> Testing NumberToLong using sys.stdout.softspace = %s
 sys.stdout.softspace = []:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got list',))
 sys.stdout.softspace = None:(<class 'TypeError'>, TypeError('expected int() or something supporting coercing to int(), but got NoneType',))
index 194a51a7e7a39a3f37902206d6a46bbcf01eb01f..14c49edd5d3b0da1b4058352c7df75824c1311b4 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2350,
 /**/
     2349,
 /**/