Karsten Hopp c6d5c1
To: vim_dev@googlegroups.com
Karsten Hopp c6d5c1
Subject: Patch 7.3.1314
Karsten Hopp c6d5c1
Fcc: outbox
Karsten Hopp c6d5c1
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c6d5c1
Mime-Version: 1.0
Karsten Hopp c6d5c1
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c6d5c1
Content-Transfer-Encoding: 8bit
Karsten Hopp c6d5c1
------------
Karsten Hopp c6d5c1
Karsten Hopp c6d5c1
Patch 7.3.1314
Karsten Hopp c6d5c1
Problem:    Test 87 fails with Python 3.3.
Karsten Hopp c6d5c1
Solution:   Filter the error messages. (Taro Muraoka)
Karsten Hopp c6d5c1
Files:	    src/testdir/test87.in
Karsten Hopp c6d5c1
Karsten Hopp c6d5c1
Karsten Hopp c6d5c1
*** ../vim-7.3.1313/src/testdir/test87.in	2013-06-26 21:49:46.000000000 +0200
Karsten Hopp c6d5c1
--- src/testdir/test87.in	2013-07-06 13:41:30.000000000 +0200
Karsten Hopp c6d5c1
***************
Karsten Hopp c6d5c1
*** 829,834 ****
Karsten Hopp c6d5c1
--- 829,838 ----
Karsten Hopp c6d5c1
  :fun D()
Karsten Hopp c6d5c1
  :endfun
Karsten Hopp c6d5c1
  py3 << EOF
Karsten Hopp c6d5c1
+ import re
Karsten Hopp c6d5c1
+ 
Karsten Hopp c6d5c1
+ py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
Karsten Hopp c6d5c1
+ 
Karsten Hopp c6d5c1
  def ee(expr, g=globals(), l=locals()):
Karsten Hopp c6d5c1
      try:
Karsten Hopp c6d5c1
          try:
Karsten Hopp c6d5c1
***************
Karsten Hopp c6d5c1
*** 836,841 ****
Karsten Hopp c6d5c1
--- 840,854 ----
Karsten Hopp c6d5c1
          except Exception as e:
Karsten Hopp c6d5c1
              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."):
Karsten Hopp c6d5c1
                  cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
Karsten Hopp c6d5c1
+             elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
Karsten Hopp c6d5c1
+                 cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
Karsten Hopp c6d5c1
+             elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
Karsten Hopp c6d5c1
+                 m = py33_type_error_pattern.search(str(e))
Karsten Hopp c6d5c1
+                 if m:
Karsten Hopp c6d5c1
+                     msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
Karsten Hopp c6d5c1
+                     cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
Karsten Hopp c6d5c1
+                 else:
Karsten Hopp c6d5c1
+                     cb.append(expr + ':' + repr((e.__class__, e)))
Karsten Hopp c6d5c1
              else:
Karsten Hopp c6d5c1
                  cb.append(expr + ':' + repr((e.__class__, e)))
Karsten Hopp c6d5c1
          else:
Karsten Hopp c6d5c1
*** ../vim-7.3.1313/src/version.c	2013-07-06 13:35:04.000000000 +0200
Karsten Hopp c6d5c1
--- src/version.c	2013-07-06 13:42:50.000000000 +0200
Karsten Hopp c6d5c1
***************
Karsten Hopp c6d5c1
*** 730,731 ****
Karsten Hopp c6d5c1
--- 730,733 ----
Karsten Hopp c6d5c1
  {   /* Add new patch number below this line */
Karsten Hopp c6d5c1
+ /**/
Karsten Hopp c6d5c1
+     1314,
Karsten Hopp c6d5c1
  /**/
Karsten Hopp c6d5c1
Karsten Hopp c6d5c1
-- 
Karsten Hopp c6d5c1
BRIDGEKEEPER: What is your favorite editor?
Karsten Hopp c6d5c1
GAWAIN:       Emacs ...  No, Viiiiiiiiiiimmmmmmm!
Karsten Hopp c6d5c1
           "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD
Karsten Hopp c6d5c1
Karsten Hopp c6d5c1
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c6d5c1
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c6d5c1
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c6d5c1
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///