summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.107
blob: 5ac7189f15417c27a37c970d7e30e9c33ad25c9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
To: vim_dev@googlegroups.com
Subject: Patch 7.4.107
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.107
Problem:    Python: When vim.eval() encounters a Vim error, a try/catch in the
	    Python code doesn't catch it. (Yggdroot Chen)
Solution:   Throw exceptions on errors in vim.eval(). (ZyX)
Files:	    src/ex_eval.c, src/if_py_both.h, src/proto/ex_eval.pro,
	    src/testdir/test86.in, src/testdir/test86.ok,
	    src/testdir/test87.in, src/testdir/test87.ok


*** ../vim-7.4.106/src/ex_eval.c	2013-06-08 15:50:28.000000000 +0200
--- src/ex_eval.c	2013-11-28 16:59:09.000000000 +0100
***************
*** 321,326 ****
--- 321,337 ----
  }
  
  /*
+  * Free global "*msg_list" and the messages it contains, then set "*msg_list"
+  * to NULL.
+  */
+     void
+ free_global_msglist()
+ {
+     free_msglist(*msg_list);
+     *msg_list = NULL;
+ }
+ 
+ /*
   * Throw the message specified in the call to cause_errthrow() above as an
   * error exception.  If cstack is NULL, postpone the throw until do_cmdline()
   * has returned (see do_one_cmd()).
***************
*** 410,475 ****
      return TRUE;
  }
  
- 
  /*
!  * Throw a new exception.  Return FAIL when out of memory or it was tried to
!  * throw an illegal user exception.  "value" is the exception string for a user
!  * or interrupt exception, or points to a message list in case of an error
!  * exception.
   */
!     static int
! throw_exception(value, type, cmdname)
      void	*value;
      int		type;
      char_u	*cmdname;
  {
!     except_T	*excp;
!     char_u	*p, *mesg, *val;
      int		cmdlen;
! 
!     /*
!      * Disallow faking Interrupt or error exceptions as user exceptions.  They
!      * would be treated differently from real interrupt or error exceptions when
!      * no active try block is found, see do_cmdline().
!      */
!     if (type == ET_USER)
!     {
! 	if (STRNCMP((char_u *)value, "Vim", 3) == 0 &&
! 		(((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':' ||
! 		 ((char_u *)value)[3] == '('))
! 	{
! 	    EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
! 	    goto fail;
! 	}
!     }
! 
!     excp = (except_T *)alloc((unsigned)sizeof(except_T));
!     if (excp == NULL)
! 	goto nomem;
  
      if (type == ET_ERROR)
      {
! 	/* Store the original message and prefix the exception value with
! 	 * "Vim:" or, if a command name is given, "Vim(cmdname):". */
! 	excp->messages = (struct msglist *)value;
! 	mesg = excp->messages->throw_msg;
  	if (cmdname != NULL && *cmdname != NUL)
  	{
  	    cmdlen = (int)STRLEN(cmdname);
! 	    excp->value = vim_strnsave((char_u *)"Vim(",
  					   4 + cmdlen + 2 + (int)STRLEN(mesg));
! 	    if (excp->value == NULL)
! 		goto nomem;
! 	    STRCPY(&excp->value[4], cmdname);
! 	    STRCPY(&excp->value[4 + cmdlen], "):");
! 	    val = excp->value + 4 + cmdlen + 2;
  	}
  	else
  	{
! 	    excp->value = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
! 	    if (excp->value == NULL)
! 		goto nomem;
! 	    val = excp->value + 4;
  	}
  
  	/* msg_add_fname may have been used to prefix the message with a file
--- 421,461 ----
      return TRUE;
  }
  
  /*
!  * Get an exception message that is to be stored in current_exception->value.
   */
!     char_u *
! get_exception_string(value, type, cmdname, should_free)
      void	*value;
      int		type;
      char_u	*cmdname;
+     int		*should_free;
  {
!     char_u	*ret, *mesg;
      int		cmdlen;
!     char_u	*p, *val;
  
      if (type == ET_ERROR)
      {
! 	*should_free = FALSE;
! 	mesg = ((struct msglist *)value)->throw_msg;
  	if (cmdname != NULL && *cmdname != NUL)
  	{
  	    cmdlen = (int)STRLEN(cmdname);
! 	    ret = vim_strnsave((char_u *)"Vim(",
  					   4 + cmdlen + 2 + (int)STRLEN(mesg));
! 	    if (ret == NULL)
! 		return ret;
! 	    STRCPY(&ret[4], cmdname);
! 	    STRCPY(&ret[4 + cmdlen], "):");
! 	    val = ret + 4 + cmdlen + 2;
  	}
  	else
  	{
! 	    ret = vim_strnsave((char_u *)"Vim:", 4 + (int)STRLEN(mesg));
! 	    if (ret == NULL)
! 		return ret;
! 	    val = ret + 4;
  	}
  
  	/* msg_add_fname may have been used to prefix the message with a file
***************
*** 506,519 ****
  	}
      }
      else
! 	excp->value = value;
  
      excp->type = type;
      excp->throw_name = vim_strsave(sourcing_name == NULL
  					      ? (char_u *)"" : sourcing_name);
      if (excp->throw_name == NULL)
      {
! 	if (type == ET_ERROR)
  	    vim_free(excp->value);
  	goto nomem;
      }
--- 492,556 ----
  	}
      }
      else
!     {
! 	*should_free = FALSE;
! 	ret = (char_u *) value;
!     }
! 
!     return ret;
! }
! 
! 
! /*
!  * Throw a new exception.  Return FAIL when out of memory or it was tried to
!  * throw an illegal user exception.  "value" is the exception string for a
!  * user or interrupt exception, or points to a message list in case of an
!  * error exception.
!  */
!     static int
! throw_exception(value, type, cmdname)
!     void	*value;
!     int		type;
!     char_u	*cmdname;
! {
!     except_T	*excp;
!     int		should_free;
! 
!     /*
!      * Disallow faking Interrupt or error exceptions as user exceptions.  They
!      * would be treated differently from real interrupt or error exceptions
!      * when no active try block is found, see do_cmdline().
!      */
!     if (type == ET_USER)
!     {
! 	if (STRNCMP((char_u *)value, "Vim", 3) == 0
! 		&& (((char_u *)value)[3] == NUL || ((char_u *)value)[3] == ':'
! 		    || ((char_u *)value)[3] == '('))
! 	{
! 	    EMSG(_("E608: Cannot :throw exceptions with 'Vim' prefix"));
! 	    goto fail;
! 	}
!     }
! 
!     excp = (except_T *)alloc((unsigned)sizeof(except_T));
!     if (excp == NULL)
! 	goto nomem;
! 
!     if (type == ET_ERROR)
! 	/* Store the original message and prefix the exception value with
! 	 * "Vim:" or, if a command name is given, "Vim(cmdname):". */
! 	excp->messages = (struct msglist *)value;
! 
!     excp->value = get_exception_string(value, type, cmdname, &should_free);
!     if (excp->value == NULL && should_free)
! 	goto nomem;
  
      excp->type = type;
      excp->throw_name = vim_strsave(sourcing_name == NULL
  					      ? (char_u *)"" : sourcing_name);
      if (excp->throw_name == NULL)
      {
! 	if (should_free)
  	    vim_free(excp->value);
  	goto nomem;
      }
***************
*** 2033,2042 ****
  	/* If an error was about to be converted to an exception when
  	 * enter_cleanup() was called, free the message list. */
  	if (msg_list != NULL)
! 	{
! 	    free_msglist(*msg_list);
! 	    *msg_list = NULL;
! 	}
      }
  
      /*
--- 2070,2076 ----
  	/* If an error was about to be converted to an exception when
  	 * enter_cleanup() was called, free the message list. */
  	if (msg_list != NULL)
! 	    free_global_msglist();
      }
  
      /*
*** ../vim-7.4.106/src/if_py_both.h	2013-11-11 01:05:43.000000000 +0100
--- src/if_py_both.h	2013-11-28 17:00:22.000000000 +0100
***************
*** 566,571 ****
--- 566,593 ----
  	PyErr_SetNone(PyExc_KeyboardInterrupt);
  	return -1;
      }
+     else if (msg_list != NULL && *msg_list != NULL)
+     {
+ 	int	should_free;
+ 	char_u	*msg;
+ 
+ 	msg = get_exception_string(*msg_list, ET_ERROR, NULL, &should_free);
+ 
+ 	if (msg == NULL)
+ 	{
+ 	    PyErr_NoMemory();
+ 	    return -1;
+ 	}
+ 
+ 	PyErr_SetVim((char *) msg);
+ 
+ 	free_global_msglist();
+ 
+ 	if (should_free)
+ 	    vim_free(msg);
+ 
+ 	return -1;
+     }
      else if (!did_throw)
  	return (PyErr_Occurred() ? -1 : 0);
      /* Python exception is preferred over vim one; unlikely to occur though */
*** ../vim-7.4.106/src/proto/ex_eval.pro	2013-08-10 13:37:10.000000000 +0200
--- src/proto/ex_eval.pro	2013-11-28 16:56:33.000000000 +0100
***************
*** 4,11 ****
--- 4,13 ----
  int should_abort __ARGS((int retcode));
  int aborted_in_try __ARGS((void));
  int cause_errthrow __ARGS((char_u *mesg, int severe, int *ignore));
+ void free_global_msglist __ARGS((void));
  void do_errthrow __ARGS((struct condstack *cstack, char_u *cmdname));
  int do_intthrow __ARGS((struct condstack *cstack));
+ char_u *get_exception_string __ARGS((void *value, int type, char_u *cmdname, int *should_free));
  void discard_current_exception __ARGS((void));
  void report_make_pending __ARGS((int pending, void *value));
  void report_resume_pending __ARGS((int pending, void *value));
*** ../vim-7.4.106/src/testdir/test86.in	2013-11-11 01:05:43.000000000 +0100
--- src/testdir/test86.in	2013-11-28 16:41:01.000000000 +0100
***************
*** 179,184 ****
--- 179,210 ----
  :unlockvar! l
  :"
  :" Function calls
+ py << EOF
+ import sys
+ def ee(expr, g=globals(), l=locals()):
+     try:
+         exec(expr, g, l)
+     except:
+         ei = sys.exc_info()
+         msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args)
+         msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'')
+         if expr.find('None') > -1:
+             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
+                               'TypeError:("\'NoneType\' object is not iterable",)')
+         if expr.find('FailingNumber') > -1:
+             msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'')
+             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
+                               'TypeError:("\'FailingNumber\' object is not iterable",)')
+         if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
+             msg = msg.replace('(\'', '("').replace('\',)', '",)')
+         if expr == 'fd(self=[])':
+             # HACK: PyMapping_Check changed meaning
+             msg = msg.replace('AttributeError:(\'keys\',)',
+                               'TypeError:(\'unable to convert list to vim dictionary\',)')
+         vim.current.buffer.append(expr + ':' + msg)
+     else:
+         vim.current.buffer.append(expr + ':NOT FAILED')
+ EOF
  :fun New(...)
  :   return ['NewStart']+a:000+['NewEnd']
  :endfun
***************
*** 193,210 ****
  :$put =string(l)
  :py l.extend([l[0].name])
  :$put =string(l)
! :try
! :   py l[1](1, 2, 3)
! :catch
! :   $put =v:exception[:16]
! :endtry
  :py f=l[0]
  :delfunction New
! :try
! :   py f(1, 2, 3)
! :catch
! :   $put =v:exception[:16]
! :endtry
  :if has('float')
  :   let l=[0.0]
  :   py l=vim.bindeval('l')
--- 219,228 ----
  :$put =string(l)
  :py l.extend([l[0].name])
  :$put =string(l)
! :py ee('l[1](1, 2, 3)')
  :py f=l[0]
  :delfunction New
! :py ee('f(1, 2, 3)')
  :if has('float')
  :   let l=[0.0]
  :   py l=vim.bindeval('l')
***************
*** 216,222 ****
  :let messages=[]
  :delfunction DictNew
  py <<EOF
- import sys
  d=vim.bindeval('{}')
  m=vim.bindeval('messages')
  def em(expr, g=globals(), l=locals()):
--- 234,239 ----
***************
*** 323,328 ****
--- 340,346 ----
  :py l[0] = t.t > 8  # check if the background thread is working
  :py del time
  :py del threading
+ :py del t
  :$put =string(l)
  :"
  :" settrace
***************
*** 882,910 ****
  :fun D()
  :endfun
  py << EOF
- def ee(expr, g=globals(), l=locals()):
-     try:
-         exec(expr, g, l)
-     except:
-         ei = sys.exc_info()
-         msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args)
-         msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'')
-         if expr.find('None') > -1:
-             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
-                               'TypeError:("\'NoneType\' object is not iterable",)')
-         if expr.find('FailingNumber') > -1:
-             msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'')
-             msg = msg.replace('TypeError:(\'iteration over non-sequence\',)',
-                               'TypeError:("\'FailingNumber\' object is not iterable",)')
-         if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
-             msg = msg.replace('(\'', '("').replace('\',)', '",)')
-         if expr == 'fd(self=[])':
-             # HACK: PyMapping_Check changed meaning
-             msg = msg.replace('AttributeError:(\'keys\',)',
-                               'TypeError:(\'unable to convert list to vim dictionary\',)')
-         cb.append(expr + ':' + msg)
-     else:
-         cb.append(expr + ':NOT FAILED')
  d = vim.Dictionary()
  ned = vim.Dictionary(foo='bar', baz='abcD')
  dl = vim.Dictionary(a=1)
--- 900,905 ----
***************
*** 1276,1281 ****
--- 1271,1277 ----
  ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
  ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
  ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
+ ee('vim.eval("xxx_unknown_function_xxx()")')
  ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
  del Exe
  EOF
*** ../vim-7.4.106/src/testdir/test86.ok	2013-11-11 01:05:43.000000000 +0100
--- src/testdir/test86.ok	2013-11-28 16:41:01.000000000 +0100
***************
*** 53,60 ****
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
! Vim(python):E725:
! Vim(python):E117:
  [0.0, 0.0]
  KeyError
  TypeError
--- 53,60 ----
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
! l[1](1, 2, 3):error:('Vim:E725: Calling dict function without Dictionary: DictNew',)
! f(1, 2, 3):error:('Vim:E117: Unknown function: New',)
  [0.0, 0.0]
  KeyError
  TypeError
***************
*** 1197,1202 ****
--- 1197,1203 ----
  vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
  vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',)
  vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
+ vim.eval("xxx_unknown_function_xxx()"):error:('Vim:E117: Unknown function: xxx_unknown_function_xxx',)
  vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)
  Caught KeyboardInterrupt
  Running :put
*** ../vim-7.4.106/src/testdir/test87.in	2013-11-11 01:05:43.000000000 +0100
--- src/testdir/test87.in	2013-11-28 16:41:01.000000000 +0100
***************
*** 172,177 ****
--- 172,207 ----
  :unlockvar! l
  :"
  :" Function calls
+ py3 << EOF
+ import sys
+ import re
+ 
+ py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
+ 
+ def ee(expr, g=globals(), l=locals()):
+     cb = vim.current.buffer
+     try:
+         try:
+             exec(expr, g, l)
+         except Exception as e:
+             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."):
+                 cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
+             elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
+                 cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
+             elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
+                 m = py33_type_error_pattern.search(str(e))
+                 if m:
+                     msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
+                     cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
+                 else:
+                     cb.append(expr + ':' + repr((e.__class__, e)))
+             else:
+                 cb.append(expr + ':' + repr((e.__class__, e)))
+         else:
+             cb.append(expr + ':NOT FAILED')
+     except Exception as e:
+         cb.append(expr + '::' + repr((e.__class__, e)))
+ EOF
  :fun New(...)
  :   return ['NewStart']+a:000+['NewEnd']
  :endfun
***************
*** 186,203 ****
  :$put =string(l)
  :py3 l+=[l[0].name]
  :$put =string(l)
! :try
! :   py3 l[1](1, 2, 3)
! :catch
! :   $put =v:exception[:13]
! :endtry
  :py3 f=l[0]
  :delfunction New
! :try
! :   py3 f(1, 2, 3)
! :catch
! :   $put =v:exception[:13]
! :endtry
  :if has('float')
  :   let l=[0.0]
  :   py3 l=vim.bindeval('l')
--- 216,225 ----
  :$put =string(l)
  :py3 l+=[l[0].name]
  :$put =string(l)
! :py3 ee('l[1](1, 2, 3)')
  :py3 f=l[0]
  :delfunction New
! :py3 ee('f(1, 2, 3)')
  :if has('float')
  :   let l=[0.0]
  :   py3 l=vim.bindeval('l')
***************
*** 315,320 ****
--- 337,343 ----
  :py3 l[0] = t.t > 8  # check if the background thread is working
  :py3 del time
  :py3 del threading
+ :py3 del t
  :$put =string(l)
  :"
  :" settrace
***************
*** 829,861 ****
  :fun D()
  :endfun
  py3 << EOF
- import re
- 
- py33_type_error_pattern = re.compile('^__call__\(\) takes (\d+) positional argument but (\d+) were given$')
- 
- def ee(expr, g=globals(), l=locals()):
-     try:
-         try:
-             exec(expr, g, l)
-         except Exception as e:
-             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."):
-                 cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1]))))
-             elif sys.version_info >= (3, 3) and e.__class__ is ImportError and str(e).find('No module named \'') >= 0:
-                 cb.append(expr + ':' + repr((e.__class__, ImportError(str(e).replace("'", '')))))
-             elif sys.version_info >= (3, 3) and e.__class__ is TypeError:
-                 m = py33_type_error_pattern.search(str(e))
-                 if m:
-                     msg = '__call__() takes exactly {0} positional argument ({1} given)'.format(m.group(1), m.group(2))
-                     cb.append(expr + ':' + repr((e.__class__, TypeError(msg))))
-                 else:
-                     cb.append(expr + ':' + repr((e.__class__, e)))
-             else:
-                 cb.append(expr + ':' + repr((e.__class__, e)))
-         else:
-             cb.append(expr + ':NOT FAILED')
-     except Exception as e:
-         cb.append(expr + '::' + repr((e.__class__, e)))
- 
  d = vim.Dictionary()
  ned = vim.Dictionary(foo='bar', baz='abcD')
  dl = vim.Dictionary(a=1)
--- 852,857 ----
***************
*** 1227,1232 ****
--- 1223,1229 ----
  ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
  ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
  ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
+ ee('vim.eval("xxx_unknown_function_xxx()")')
  ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
  del Exe
  EOF
*** ../vim-7.4.106/src/testdir/test87.ok	2013-11-11 01:05:43.000000000 +0100
--- src/testdir/test87.ok	2013-11-28 16:41:01.000000000 +0100
***************
*** 53,60 ****
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
! Vim(py3):E725:
! Vim(py3):E117:
  [0.0, 0.0]
  KeyError
  TypeError
--- 53,60 ----
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
  [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
! l[1](1, 2, 3):(<class 'vim.error'>, error('Vim:E725: Calling dict function without Dictionary: DictNew',))
! f(1, 2, 3):(<class 'vim.error'>, error('Vim:E117: Unknown function: New',))
  [0.0, 0.0]
  KeyError
  TypeError
***************
*** 1186,1191 ****
--- 1186,1192 ----
  vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
  vim.eval("Exe('echoerr ''jkl''')"):(<class 'vim.error'>, error('Vim(echoerr):jkl',))
  vim.eval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
+ vim.eval("xxx_unknown_function_xxx()"):(<class 'vim.error'>, error('Vim:E117: Unknown function: xxx_unknown_function_xxx',))
  vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
  Caught KeyboardInterrupt
  Running :put
*** ../vim-7.4.106/src/version.c	2013-11-28 16:32:34.000000000 +0100
--- src/version.c	2013-11-28 16:41:43.000000000 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     107,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
8. You spend half of the plane trip with your laptop on your lap...and your
   child in the overhead compartment.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///