home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.107 < prev    next >
Encoding:
Internet Message Format  |  2013-11-27  |  21.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.107
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.107
  11. Problem:    Python: When vim.eval() encounters a Vim error, a try/catch in the
  12.         Python code doesn't catch it. (Yggdroot Chen)
  13. Solution:   Throw exceptions on errors in vim.eval(). (ZyX)
  14. Files:        src/ex_eval.c, src/if_py_both.h, src/proto/ex_eval.pro,
  15.         src/testdir/test86.in, src/testdir/test86.ok,
  16.         src/testdir/test87.in, src/testdir/test87.ok
  17.  
  18.  
  19. *** ../vim-7.4.106/src/ex_eval.c    2013-06-08 15:50:28.000000000 +0200
  20. --- src/ex_eval.c    2013-11-28 16:59:09.000000000 +0100
  21. ***************
  22. *** 321,326 ****
  23. --- 321,337 ----
  24.   }
  25.   
  26.   /*
  27. +  * Free global "*msg_list" and the messages it contains, then set "*msg_list"
  28. +  * to NULL.
  29. +  */
  30. +     void
  31. + free_global_msglist()
  32. + {
  33. +     free_msglist(*msg_list);
  34. +     *msg_list = NULL;
  35. + }
  36. + /*
  37.    * Throw the message specified in the call to cause_errthrow() above as an
  38.    * error exception.  If cstack is NULL, postpone the throw until do_cmdline()
  39.    * has returned (see do_one_cmd()).
  40. ***************
  41. *** 410,475 ****
  42.       return TRUE;
  43.   }
  44.   
  45.   /*
  46. !  * Throw a new exception.  Return FAIL when out of memory or it was tried to
  47. !  * throw an illegal user exception.  "value" is the exception string for a user
  48. !  * or interrupt exception, or points to a message list in case of an error
  49. !  * exception.
  50.    */
  51. !     static int
  52. ! throw_exception(value, type, cmdname)
  53.       void    *value;
  54.       int        type;
  55.       char_u    *cmdname;
  56.   {
  57. !     except_T    *excp;
  58. !     char_u    *p, *mesg, *val;
  59.       int        cmdlen;
  60. !     /*
  61. !      * Disallow faking Interrupt or error exceptions as user exceptions.  They
  62. !      * would be treated differently from real interrupt or error exceptions when
  63. !      * no active try block is found, see do_cmdline().
  64. !      */
  65. !     if (type == ET_USER)
  66. !     {
  67. !     if (STRNCMP((char_u *)value, "Vim", 3) == 0 &&
  68. !         (((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':' ||
  69. !          ((char_u *)value)[3] == '('))
  70. !     {
  71. !         EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
  72. !         goto fail;
  73. !     }
  74. !     }
  75. !     excp = (except_T *)alloc((unsigned)sizeof(except_T));
  76. !     if (excp == NULL)
  77. !     goto nomem;
  78.   
  79.       if (type == ET_ERROR)
  80.       {
  81. !     /* Store the original message and prefix the exception value with
  82. !      * "Vim:" or, if a command name is given, "Vim(cmdname):". */
  83. !     excp->messages = (struct msglist *)value;
  84. !     mesg = excp->messages->throw_msg;
  85.       if (cmdname != NULL && *cmdname != NUL)
  86.       {
  87.           cmdlen = (int)STRLEN(cmdname);
  88. !         excp->value = vim_strnsave((char_u *)"Vim(",
  89.                          4 + cmdlen + 2 + (int)STRLEN(mesg));
  90. !         if (excp->value == NULL)
  91. !         goto nomem;
  92. !         STRCPY(&excp->value[4], cmdname);
  93. !         STRCPY(&excp->value[4 + cmdlen], "):");
  94. !         val = excp->value + 4 + cmdlen + 2;
  95.       }
  96.       else
  97.       {
  98. !         excp->value = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
  99. !         if (excp->value == NULL)
  100. !         goto nomem;
  101. !         val = excp->value + 4;
  102.       }
  103.   
  104.       /* msg_add_fname may have been used to prefix the message with a file
  105. --- 421,461 ----
  106.       return TRUE;
  107.   }
  108.   
  109.   /*
  110. !  * Get an exception message that is to be stored in current_exception->value.
  111.    */
  112. !     char_u *
  113. ! get_exception_string(value, type, cmdname, should_free)
  114.       void    *value;
  115.       int        type;
  116.       char_u    *cmdname;
  117. +     int        *should_free;
  118.   {
  119. !     char_u    *ret, *mesg;
  120.       int        cmdlen;
  121. !     char_u    *p, *val;
  122.   
  123.       if (type == ET_ERROR)
  124.       {
  125. !     *should_free = FALSE;
  126. !     mesg = ((struct msglist *)value)->throw_msg;
  127.       if (cmdname != NULL && *cmdname != NUL)
  128.       {
  129.           cmdlen = (int)STRLEN(cmdname);
  130. !         ret = vim_strnsave((char_u *)"Vim(",
  131.                          4 + cmdlen + 2 + (int)STRLEN(mesg));
  132. !         if (ret == NULL)
  133. !         return ret;
  134. !         STRCPY(&ret[4], cmdname);
  135. !         STRCPY(&ret[4 + cmdlen], "):");
  136. !         val = ret + 4 + cmdlen + 2;
  137.       }
  138.       else
  139.       {
  140. !         ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
  141. !         if (ret == NULL)
  142. !         return ret;
  143. !         val = ret + 4;
  144.       }
  145.   
  146.       /* msg_add_fname may have been used to prefix the message with a file
  147. ***************
  148. *** 506,519 ****
  149.       }
  150.       }
  151.       else
  152. !     excp->value = value;
  153.   
  154.       excp->type = type;
  155.       excp->throw_name = vim_strsave(sourcing_name == NULL
  156.                             ? (char_u *)"" : sourcing_name);
  157.       if (excp->throw_name == NULL)
  158.       {
  159. !     if (type == ET_ERROR)
  160.           vim_free(excp->value);
  161.       goto nomem;
  162.       }
  163. --- 492,556 ----
  164.       }
  165.       }
  166.       else
  167. !     {
  168. !     *should_free = FALSE;
  169. !     ret = (char_u *) value;
  170. !     }
  171. !     return ret;
  172. ! }
  173. ! /*
  174. !  * Throw a new exception.  Return FAIL when out of memory or it was tried to
  175. !  * throw an illegal user exception.  "value" is the exception string for a
  176. !  * user or interrupt exception, or points to a message list in case of an
  177. !  * error exception.
  178. !  */
  179. !     static int
  180. ! throw_exception(value, type, cmdname)
  181. !     void    *value;
  182. !     int        type;
  183. !     char_u    *cmdname;
  184. ! {
  185. !     except_T    *excp;
  186. !     int        should_free;
  187. !     /*
  188. !      * Disallow faking Interrupt or error exceptions as user exceptions.  They
  189. !      * would be treated differently from real interrupt or error exceptions
  190. !      * when no active try block is found, see do_cmdline().
  191. !      */
  192. !     if (type == ET_USER)
  193. !     {
  194. !     if (STRNCMP((char_u *)value, "Vim", 3) == 0
  195. !         && (((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':'
  196. !             || ((char_u *)value)[3] == '('))
  197. !     {
  198. !         EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
  199. !         goto fail;
  200. !     }
  201. !     }
  202. !     excp = (except_T *)alloc((unsigned)sizeof(except_T));
  203. !     if (excp == NULL)
  204. !     goto nomem;
  205. !     if (type == ET_ERROR)
  206. !     /* Store the original message and prefix the exception value with
  207. !      * "Vim:" or, if a command name is given, "Vim(cmdname):". */
  208. !     excp->messages = (struct msglist *)value;
  209. !     excp->value = get_exception_string(value, type, cmdname, &should_free);
  210. !     if (excp->value == NULL && should_free)
  211. !     goto nomem;
  212.   
  213.       excp->type = type;
  214.       excp->throw_name = vim_strsave(sourcing_name == NULL
  215.                             ? (char_u *)"" : sourcing_name);
  216.       if (excp->throw_name == NULL)
  217.       {
  218. !     if (should_free)
  219.           vim_free(excp->value);
  220.       goto nomem;
  221.       }
  222. ***************
  223. *** 2033,2042 ****
  224.       /* If an error was about to be converted to an exception when
  225.        * enter_cleanup() was called, free the message list. */
  226.       if (msg_list != NULL)
  227. !     {
  228. !         free_msglist(*msg_list);
  229. !         *msg_list = NULL;
  230. !     }
  231.       }
  232.   
  233.       /*
  234. --- 2070,2076 ----
  235.       /* If an error was about to be converted to an exception when
  236.        * enter_cleanup() was called, free the message list. */
  237.       if (msg_list != NULL)
  238. !         free_global_msglist();
  239.       }
  240.   
  241.       /*
  242. *** ../vim-7.4.106/src/if_py_both.h    2013-11-11 01:05:43.000000000 +0100
  243. --- src/if_py_both.h    2013-11-28 17:00:22.000000000 +0100
  244. ***************
  245. *** 566,571 ****
  246. --- 566,593 ----
  247.       PyErr_SetNone(PyExc_KeyboardInterrupt);
  248.       return -1;
  249.       }
  250. +     else if (msg_list != NULL && *msg_list != NULL)
  251. +     {
  252. +     int    should_free;
  253. +     char_u    *msg;
  254. +     msg = get_exception_string(*msg_list, ET_ERROR, NULL, &should_free);
  255. +     if (msg == NULL)
  256. +     {
  257. +         PyErr_NoMemory();
  258. +         return -1;
  259. +     }
  260. +     PyErr_SetVim((char *) msg);
  261. +     free_global_msglist();
  262. +     if (should_free)
  263. +         vim_free(msg);
  264. +     return -1;
  265. +     }
  266.       else if (!did_throw)
  267.       return (PyErr_Occurred() ? -1 : 0);
  268.       /* Python exception is preferred over vim one; unlikely to occur though */
  269. *** ../vim-7.4.106/src/proto/ex_eval.pro    2013-08-10 13:37:10.000000000 +0200
  270. --- src/proto/ex_eval.pro    2013-11-28 16:56:33.000000000 +0100
  271. ***************
  272. *** 4,11 ****
  273. --- 4,13 ----
  274.   int should_abort __ARGS((int retcode));
  275.   int aborted_in_try __ARGS((void));
  276.   int cause_errthrow __ARGS((char_u *mesg, int severe, int *ignore));
  277. + void free_global_msglist __ARGS((void));
  278.   void do_errthrow __ARGS((struct condstack *cstack, char_u *cmdname));
  279.   int do_intthrow __ARGS((struct condstack *cstack));
  280. + char_u *get_exception_string __ARGS((void *value, int type, char_u *cmdname, int *should_free));
  281.   void discard_current_exception __ARGS((void));
  282.   void report_make_pending __ARGS((int pending, void *value));
  283.   void report_resume_pending __ARGS((int pending, void *value));
  284. *** ../vim-7.4.106/src/testdir/test86.in    2013-11-11 01:05:43.000000000 +0100
  285. --- src/testdir/test86.in    2013-11-28 16:41:01.000000000 +0100
  286. ***************
  287. *** 179,184 ****
  288. --- 179,210 ----
  289.   :unlockvar! l
  290.   :"
  291.   :" Function calls
  292. + py << EOF
  293. + import sys
  294. + def ee(expr, g=globals(), l=locals()):
  295. +     try:
  296. +         exec(expr, g, l)
  297. +     except:
  298. +         ei = sys.exc_info()
  299. +         msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args)
  300. +         msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'')
  301. +         if expr.find('None') > -1:
  302. +             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
  303. +                               'TypeError:("\'NoneType\' object is not iterable",)')
  304. +         if expr.find('FailingNumber') > -1:
  305. +             msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'')
  306. +             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
  307. +                               'TypeError:("\'FailingNumber\' object is not iterable",)')
  308. +         if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
  309. +             msg = msg.replace('(\'', '("').replace('\',)', '",)')
  310. +         if expr == 'fd(self=[])':
  311. +             # HACK: PyMapping_Check changed meaning
  312. +             msg = msg.replace('AttributeError:(\'keys\',)',
  313. +                               'TypeError:(\'unable to convert list to vim dictionary\',)')
  314. +         vim.current.buffer.append(expr + ':' + msg)
  315. +     else:
  316. +         vim.current.buffer.append(expr + ':NOT FAILED')
  317. + EOF
  318.   :fun New(...)
  319.   :   return ['NewStart']+a:000+['NewEnd']
  320.   :endfun
  321. ***************
  322. *** 193,210 ****
  323.   :$put =string(l)
  324.   :py l.extend([l[0].name])
  325.   :$put =string(l)
  326. ! :try
  327. ! :   py l[1](1, 2, 3)
  328. ! :catch
  329. ! :   $put =v:exception[:16]
  330. ! :endtry
  331.   :py f=l[0]
  332.   :delfunction New
  333. ! :try
  334. ! :   py f(1, 2, 3)
  335. ! :catch
  336. ! :   $put =v:exception[:16]
  337. ! :endtry
  338.   :if has('float')
  339.   :   let l=[0.0]
  340.   :   py l=vim.bindeval('l')
  341. --- 219,228 ----
  342.   :$put =string(l)
  343.   :py l.extend([l[0].name])
  344.   :$put =string(l)
  345. ! :py ee('l[1](1, 2, 3)')
  346.   :py f=l[0]
  347.   :delfunction New
  348. ! :py ee('f(1, 2, 3)')
  349.   :if has('float')
  350.   :   let l=[0.0]
  351.   :   py l=vim.bindeval('l')
  352. ***************
  353. *** 216,222 ****
  354.   :let messages=[]
  355.   :delfunction DictNew
  356.   py <<EOF
  357. - import sys
  358.   d=vim.bindeval('{}')
  359.   m=vim.bindeval('messages')
  360.   def em(expr, g=globals(), l=locals()):
  361. --- 234,239 ----
  362. ***************
  363. *** 323,328 ****
  364. --- 340,346 ----
  365.   :py l[0] = t.t > 8  # check if the background thread is working
  366.   :py del time
  367.   :py del threading
  368. + :py del t
  369.   :$put =string(l)
  370.   :"
  371.   :" settrace
  372. ***************
  373. *** 882,910 ****
  374.   :fun D()
  375.   :endfun
  376.   py << EOF
  377. - def ee(expr, g=globals(), l=locals()):
  378. -     try:
  379. -         exec(expr, g, l)
  380. -     except:
  381. -         ei = sys.exc_info()
  382. -         msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args)
  383. -         msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'')
  384. -         if expr.find('None') > -1:
  385. -             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
  386. -                               'TypeError:("\'NoneType\' object is not iterable",)')
  387. -         if expr.find('FailingNumber') > -1:
  388. -             msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'')
  389. -             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
  390. -                               'TypeError:("\'FailingNumber\' object is not iterable",)')
  391. -         if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
  392. -             msg = msg.replace('(\'', '("').replace('\',)', '",)')
  393. -         if expr == 'fd(self=[])':
  394. -             # HACK: PyMapping_Check changed meaning
  395. -             msg = msg.replace('AttributeError:(\'keys\',)',
  396. -                               'TypeError:(\'unable to convert list to vim dictionary\',)')
  397. -         cb.append(expr + ':' + msg)
  398. -     else:
  399. -         cb.append(expr + ':NOT FAILED')
  400.   d = vim.Dictionary()
  401.   ned = vim.Dictionary(foo='bar', baz='abcD')
  402.   dl = vim.Dictionary(a=1)
  403. --- 900,905 ----
  404. ***************
  405. *** 1276,1281 ****
  406. --- 1271,1277 ----
  407.   ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
  408.   ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
  409.   ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
  410. + ee('vim.eval("xxx_unknown_function_xxx()")')
  411.   ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
  412.   del Exe
  413.   EOF
  414. *** ../vim-7.4.106/src/testdir/test86.ok    2013-11-11 01:05:43.000000000 +0100
  415. --- src/testdir/test86.ok    2013-11-28 16:41:01.000000000 +0100
  416. ***************
  417. *** 53,60 ****
  418.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  419.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  420.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
  421. ! Vim(python):E725:
  422. ! Vim(python):E117:
  423.   [0.0, 0.0]
  424.   KeyError
  425.   TypeError
  426. --- 53,60 ----
  427.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  428.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  429.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
  430. ! l[1](1, 2, 3):error:('Vim:E725: Calling dict function without Dictionary: DictNew',)
  431. ! f(1, 2, 3):error:('Vim:E117: Unknown function: New',)
  432.   [0.0, 0.0]
  433.   KeyError
  434.   TypeError
  435. ***************
  436. *** 1197,1202 ****
  437. --- 1197,1203 ----
  438.   vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
  439.   vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',)
  440.   vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
  441. + vim.eval("xxx_unknown_function_xxx()"):error:('Vim:E117: Unknown function: xxx_unknown_function_xxx',)
  442.   vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
  443.   Caught KeyboardInterrupt
  444.   Running :put
  445. *** ../vim-7.4.106/src/testdir/test87.in    2013-11-11 01:05:43.000000000 +0100
  446. --- src/testdir/test87.in    2013-11-28 16:41:01.000000000 +0100
  447. ***************
  448. *** 172,177 ****
  449. --- 172,207 ----
  450.   :unlockvar! l
  451.   :"
  452.   :" Function calls
  453. + py3 << EOF
  454. + import sys
  455. + import re
  456. + py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
  457. + def ee(expr, g=globals(), l=locals()):
  458. +     cb = vim.current.buffer
  459. +     try:
  460. +         try:
  461. +             exec(expr, g, l)
  462. +         except Exception as e:
  463. +             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."):
  464. +                 cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
  465. +             elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
  466. +                 cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
  467. +             elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
  468. +                 m = py33_type_error_pattern.search(str(e))
  469. +                 if m:
  470. +                     msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
  471. +                     cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
  472. +                 else:
  473. +                     cb.append(expr + ':' + repr((e.__class__, e)))
  474. +             else:
  475. +                 cb.append(expr + ':' + repr((e.__class__, e)))
  476. +         else:
  477. +             cb.append(expr + ':NOT FAILED')
  478. +     except Exception as e:
  479. +         cb.append(expr + '::' + repr((e.__class__, e)))
  480. + EOF
  481.   :fun New(...)
  482.   :   return ['NewStart']+a:000+['NewEnd']
  483.   :endfun
  484. ***************
  485. *** 186,203 ****
  486.   :$put =string(l)
  487.   :py3 l+=[l[0].name]
  488.   :$put =string(l)
  489. ! :try
  490. ! :   py3 l[1](1, 2, 3)
  491. ! :catch
  492. ! :   $put =v:exception[:13]
  493. ! :endtry
  494.   :py3 f=l[0]
  495.   :delfunction New
  496. ! :try
  497. ! :   py3 f(1, 2, 3)
  498. ! :catch
  499. ! :   $put =v:exception[:13]
  500. ! :endtry
  501.   :if has('float')
  502.   :   let l=[0.0]
  503.   :   py3 l=vim.bindeval('l')
  504. --- 216,225 ----
  505.   :$put =string(l)
  506.   :py3 l+=[l[0].name]
  507.   :$put =string(l)
  508. ! :py3 ee('l[1](1, 2, 3)')
  509.   :py3 f=l[0]
  510.   :delfunction New
  511. ! :py3 ee('f(1, 2, 3)')
  512.   :if has('float')
  513.   :   let l=[0.0]
  514.   :   py3 l=vim.bindeval('l')
  515. ***************
  516. *** 315,320 ****
  517. --- 337,343 ----
  518.   :py3 l[0] = t.t > 8  # check if the background thread is working
  519.   :py3 del time
  520.   :py3 del threading
  521. + :py3 del t
  522.   :$put =string(l)
  523.   :"
  524.   :" settrace
  525. ***************
  526. *** 829,861 ****
  527.   :fun D()
  528.   :endfun
  529.   py3 << EOF
  530. - import re
  531. - py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
  532. - def ee(expr, g=globals(), l=locals()):
  533. -     try:
  534. -         try:
  535. -             exec(expr, g, l)
  536. -         except Exception as e:
  537. -             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."):
  538. -                 cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
  539. -             elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
  540. -                 cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
  541. -             elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
  542. -                 m = py33_type_error_pattern.search(str(e))
  543. -                 if m:
  544. -                     msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
  545. -                     cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
  546. -                 else:
  547. -                     cb.append(expr + ':' + repr((e.__class__, e)))
  548. -             else:
  549. -                 cb.append(expr + ':' + repr((e.__class__, e)))
  550. -         else:
  551. -             cb.append(expr + ':NOT FAILED')
  552. -     except Exception as e:
  553. -         cb.append(expr + '::' + repr((e.__class__, e)))
  554.   d = vim.Dictionary()
  555.   ned = vim.Dictionary(foo='bar', baz='abcD')
  556.   dl = vim.Dictionary(a=1)
  557. --- 852,857 ----
  558. ***************
  559. *** 1227,1232 ****
  560. --- 1223,1229 ----
  561.   ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
  562.   ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
  563.   ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
  564. + ee('vim.eval("xxx_unknown_function_xxx()")')
  565.   ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
  566.   del Exe
  567.   EOF
  568. *** ../vim-7.4.106/src/testdir/test87.ok    2013-11-11 01:05:43.000000000 +0100
  569. --- src/testdir/test87.ok    2013-11-28 16:41:01.000000000 +0100
  570. ***************
  571. *** 53,60 ****
  572.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  573.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  574.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
  575. ! Vim(py3):E725:
  576. ! Vim(py3):E117:
  577.   [0.0, 0.0]
  578.   KeyError
  579.   TypeError
  580. --- 53,60 ----
  581.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  582.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  583.   [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
  584. ! l[1](1, 2, 3):(<class 'vim.error'>, error('Vim:E725: Calling dict function without Dictionary: DictNew',))
  585. ! f(1, 2, 3):(<class 'vim.error'>, error('Vim:E117: Unknown function: New',))
  586.   [0.0, 0.0]
  587.   KeyError
  588.   TypeError
  589. ***************
  590. *** 1186,1191 ****
  591. --- 1186,1192 ----
  592.   vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
  593.   vim.eval("Exe('echoerr ''jkl''')"):(<class 'vim.error'>, error('Vim(echoerr):jkl',))
  594.   vim.eval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
  595. + vim.eval("xxx_unknown_function_xxx()"):(<class 'vim.error'>, error('Vim:E117: Unknown function: xxx_unknown_function_xxx',))
  596.   vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
  597.   Caught KeyboardInterrupt
  598.   Running :put
  599. *** ../vim-7.4.106/src/version.c    2013-11-28 16:32:34.000000000 +0100
  600. --- src/version.c    2013-11-28 16:41:43.000000000 +0100
  601. ***************
  602. *** 740,741 ****
  603. --- 740,743 ----
  604.   {   /* Add new patch number below this line */
  605. + /**/
  606. +     107,
  607.   /**/
  608.  
  609. -- 
  610. hundred-and-one symptoms of being an internet addict:
  611. 8. You spend half of the plane trip with your laptop on your lap...and your
  612.    child in the overhead compartment.
  613.  
  614.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  615. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  616. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  617.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  618.