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.3 / 7.3.1229 < prev    next >
Encoding:
Internet Message Format  |  2013-06-22  |  33.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1229
  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.3.1229
  11. Problem:    Python: not so easy to delete/restore translating.
  12. Solution:   Make macros do translation of exception messages. (ZyX)
  13.             Note: this breaks translations!
  14. Files:      src/if_py_both.h, src/if_python3.c
  15.  
  16.  
  17. *** ../vim-7.3.1228/src/if_py_both.h    2013-06-23 13:11:14.000000000 +0200
  18. --- src/if_py_both.h    2013-06-23 13:19:01.000000000 +0200
  19. ***************
  20. *** 26,35 ****
  21.   
  22.   static const char *vim_special_path = "_vim_path_";
  23.   
  24.   #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
  25.   
  26. ! #define RAISE_NO_EMPTY_KEYS PyErr_SetString(PyExc_ValueError, \
  27. !                         _("empty keys are not allowed"))
  28.   
  29.   #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
  30.   #define INVALID_WINDOW_VALUE ((win_T *)(-1))
  31. --- 26,37 ----
  32.   
  33.   static const char *vim_special_path = "_vim_path_";
  34.   
  35. + #define PyErr_SET_STRING(exc, str) PyErr_SetString(exc, _(str))
  36.   #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
  37. + #define PyErr_SET_VIM(str) PyErr_SET_STRING(VimError, str)
  38.   
  39. ! #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \
  40. !                         "empty keys are not allowed")
  41.   
  42.   #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
  43.   #define INVALID_WINDOW_VALUE ((win_T *)(-1))
  44. ***************
  45. *** 120,126 ****
  46.       }
  47.       else
  48.       {
  49. !     PyErr_SetString(PyExc_TypeError, _("object must be string"));
  50.       return NULL;
  51.       }
  52.   
  53. --- 122,128 ----
  54.       }
  55.       else
  56.       {
  57. !     PyErr_SET_STRING(PyExc_TypeError, "object must be string");
  58.       return NULL;
  59.       }
  60.   
  61. ***************
  62. *** 212,219 ****
  63.   {
  64.       if (val == NULL)
  65.       {
  66. !     PyErr_SetString(PyExc_AttributeError,
  67. !         _("can't delete OutputObject attributes"));
  68.       return -1;
  69.       }
  70.   
  71. --- 214,221 ----
  72.   {
  73.       if (val == NULL)
  74.       {
  75. !     PyErr_SET_STRING(PyExc_AttributeError,
  76. !         "can't delete OutputObject attributes");
  77.       return -1;
  78.       }
  79.   
  80. ***************
  81. *** 221,227 ****
  82.       {
  83.       if (!PyInt_Check(val))
  84.       {
  85. !         PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
  86.           return -1;
  87.       }
  88.   
  89. --- 223,229 ----
  90.       {
  91.       if (!PyInt_Check(val))
  92.       {
  93. !         PyErr_SET_STRING(PyExc_TypeError, "softspace must be an integer");
  94.           return -1;
  95.       }
  96.   
  97. ***************
  98. *** 229,235 ****
  99.       return 0;
  100.       }
  101.   
  102. !     PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
  103.       return -1;
  104.   }
  105.   
  106. --- 231,237 ----
  107.       return 0;
  108.       }
  109.   
  110. !     PyErr_SET_STRING(PyExc_AttributeError, "invalid attribute");
  111.       return -1;
  112.   }
  113.   
  114. ***************
  115. *** 667,673 ****
  116.   
  117.       if (our_tv == NULL)
  118.       {
  119. !     PyErr_SetVim(_("invalid expression"));
  120.       return NULL;
  121.       }
  122.   
  123. --- 669,675 ----
  124.   
  125.       if (our_tv == NULL)
  126.       {
  127. !     PyErr_SET_VIM("invalid expression");
  128.       return NULL;
  129.       }
  130.   
  131. ***************
  132. *** 718,724 ****
  133.   
  134.       if (our_tv == NULL)
  135.       {
  136. !     PyErr_SetVim(_("invalid expression"));
  137.       return NULL;
  138.       }
  139.   
  140. --- 720,726 ----
  141.   
  142.       if (our_tv == NULL)
  143.       {
  144. !     PyErr_SET_VIM("invalid expression");
  145.       return NULL;
  146.       }
  147.   
  148. ***************
  149. *** 790,796 ****
  150.       if (VimTryEnd())
  151.           return NULL;
  152.   
  153. !     PyErr_SetVim(_("failed to change directory"));
  154.       return NULL;
  155.       }
  156.   
  157. --- 792,798 ----
  158.       if (VimTryEnd())
  159.           return NULL;
  160.   
  161. !     PyErr_SET_VIM("failed to change directory");
  162.       return NULL;
  163.       }
  164.   
  165. ***************
  166. *** 968,975 ****
  167.       if (!PyTuple_Check(find_module_result)
  168.           || PyTuple_GET_SIZE(find_module_result) != 3)
  169.       {
  170. !     PyErr_SetString(PyExc_TypeError,
  171. !         _("expected 3-tuple as imp.find_module() result"));
  172.       return NULL;
  173.       }
  174.   
  175. --- 970,977 ----
  176.       if (!PyTuple_Check(find_module_result)
  177.           || PyTuple_GET_SIZE(find_module_result) != 3)
  178.       {
  179. !     PyErr_SET_STRING(PyExc_TypeError,
  180. !         "expected 3-tuple as imp.find_module() result");
  181.       return NULL;
  182.       }
  183.   
  184. ***************
  185. *** 977,984 ****
  186.           || !(pathname = PyTuple_GET_ITEM(find_module_result, 1))
  187.           || !(description = PyTuple_GET_ITEM(find_module_result, 2)))
  188.       {
  189. !     PyErr_SetString(PyExc_RuntimeError,
  190. !         _("internal error: imp.find_module returned tuple with NULL"));
  191.       return NULL;
  192.       }
  193.   
  194. --- 979,986 ----
  195.           || !(pathname = PyTuple_GET_ITEM(find_module_result, 1))
  196.           || !(description = PyTuple_GET_ITEM(find_module_result, 2)))
  197.       {
  198. !     PyErr_SET_STRING(PyExc_RuntimeError,
  199. !         "internal error: imp.find_module returned tuple with NULL");
  200.       return NULL;
  201.       }
  202.   
  203. ***************
  204. *** 1349,1356 ****
  205.   {
  206.       if (val == NULL)
  207.       {
  208. !     PyErr_SetString(PyExc_AttributeError,
  209. !         _("cannot delete vim.Dictionary attributes"));
  210.       return -1;
  211.       }
  212.   
  213. --- 1351,1358 ----
  214.   {
  215.       if (val == NULL)
  216.       {
  217. !     PyErr_SET_STRING(PyExc_AttributeError,
  218. !         "cannot delete vim.Dictionary attributes");
  219.       return -1;
  220.       }
  221.   
  222. ***************
  223. *** 1358,1364 ****
  224.       {
  225.       if (self->dict->dv_lock == VAR_FIXED)
  226.       {
  227. !         PyErr_SetString(PyExc_TypeError, _("cannot modify fixed dictionary"));
  228.           return -1;
  229.       }
  230.       else
  231. --- 1360,1366 ----
  232.       {
  233.       if (self->dict->dv_lock == VAR_FIXED)
  234.       {
  235. !         PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed dictionary");
  236.           return -1;
  237.       }
  238.       else
  239. ***************
  240. *** 1375,1381 ****
  241.       }
  242.       else
  243.       {
  244. !     PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute"));
  245.       return -1;
  246.       }
  247.   }
  248. --- 1377,1383 ----
  249.       }
  250.       else
  251.       {
  252. !     PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute");
  253.       return -1;
  254.       }
  255.   }
  256. ***************
  257. *** 1457,1463 ****
  258.       {
  259.       if (dict->dv_lock)
  260.       {
  261. !         PyErr_SetVim(_("dict is locked"));
  262.           Py_DECREF(r);
  263.           return NULL;
  264.       }
  265. --- 1459,1465 ----
  266.       {
  267.       if (dict->dv_lock)
  268.       {
  269. !         PyErr_SET_VIM("dict is locked");
  270.           Py_DECREF(r);
  271.           return NULL;
  272.       }
  273. ***************
  274. *** 1508,1515 ****
  275.       if ((*dii)->ht->ht_array != (*dii)->ht_array ||
  276.           (*dii)->ht->ht_used != (*dii)->ht_used)
  277.       {
  278. !     PyErr_SetString(PyExc_RuntimeError,
  279. !         _("hashtab changed during iteration"));
  280.       return NULL;
  281.       }
  282.   
  283. --- 1510,1517 ----
  284.       if ((*dii)->ht->ht_array != (*dii)->ht_array ||
  285.           (*dii)->ht->ht_used != (*dii)->ht_used)
  286.       {
  287. !     PyErr_SET_STRING(PyExc_RuntimeError,
  288. !         "hashtab changed during iteration");
  289.       return NULL;
  290.       }
  291.   
  292. ***************
  293. *** 1560,1566 ****
  294.   
  295.       if (dict->dv_lock)
  296.       {
  297. !     PyErr_SetVim(_("dict is locked"));
  298.       return -1;
  299.       }
  300.   
  301. --- 1562,1568 ----
  302.   
  303.       if (dict->dv_lock)
  304.       {
  305. !     PyErr_SET_VIM("dict is locked");
  306.       return -1;
  307.       }
  308.   
  309. ***************
  310. *** 1615,1621 ****
  311.           Py_XDECREF(todecref);
  312.           vim_free(di);
  313.           dictitem_free(di);
  314. !         PyErr_SetVim(_("failed to add key to dictionary"));
  315.           return -1;
  316.       }
  317.       }
  318. --- 1617,1623 ----
  319.           Py_XDECREF(todecref);
  320.           vim_free(di);
  321.           dictitem_free(di);
  322. !         PyErr_SET_VIM("failed to add key to dictionary");
  323.           return -1;
  324.       }
  325.       }
  326. ***************
  327. *** 1723,1729 ****
  328.   
  329.       if (dict->dv_lock)
  330.       {
  331. !     PyErr_SetVim(_("dict is locked"));
  332.       return NULL;
  333.       }
  334.   
  335. --- 1725,1731 ----
  336.   
  337.       if (dict->dv_lock)
  338.       {
  339. !     PyErr_SET_VIM("dict is locked");
  340.       return NULL;
  341.       }
  342.   
  343. ***************
  344. *** 1779,1786 ****
  345.           {
  346.               Py_DECREF(iterator);
  347.               Py_DECREF(fast);
  348. !             PyErr_SetString(PyExc_ValueError,
  349. !                 _("expected sequence element of size 2"));
  350.               return NULL;
  351.           }
  352.   
  353. --- 1781,1788 ----
  354.           {
  355.               Py_DECREF(iterator);
  356.               Py_DECREF(fast);
  357. !             PyErr_SET_STRING(PyExc_ValueError,
  358. !                 "expected sequence element of size 2");
  359.               return NULL;
  360.           }
  361.   
  362. ***************
  363. *** 1823,1829 ****
  364.           {
  365.               Py_DECREF(iterator);
  366.               dictitem_free(di);
  367. !             PyErr_SetVim(_("failed to add key to dictionary"));
  368.               return NULL;
  369.           }
  370.           }
  371. --- 1825,1831 ----
  372.           {
  373.               Py_DECREF(iterator);
  374.               dictitem_free(di);
  375. !             PyErr_SET_VIM("failed to add key to dictionary");
  376.               return NULL;
  377.           }
  378.           }
  379. ***************
  380. *** 2021,2028 ****
  381.   
  382.       if (kwargs)
  383.       {
  384. !     PyErr_SetString(PyExc_TypeError,
  385. !         _("list constructor does not accept keyword arguments"));
  386.       return NULL;
  387.       }
  388.   
  389. --- 2023,2030 ----
  390.   
  391.       if (kwargs)
  392.       {
  393. !     PyErr_SET_STRING(PyExc_TypeError,
  394. !         "list constructor does not accept keyword arguments");
  395.       return NULL;
  396.       }
  397.   
  398. ***************
  399. *** 2077,2089 ****
  400.   
  401.       if (index >= ListLength(self))
  402.       {
  403. !     PyErr_SetString(PyExc_IndexError, _("list index out of range"));
  404.       return NULL;
  405.       }
  406.       li = list_find(self->list, (long) index);
  407.       if (li == NULL)
  408.       {
  409. !     PyErr_SetVim(_("internal error: failed to get vim list item"));
  410.       return NULL;
  411.       }
  412.       return ConvertToPyObject(&li->li_tv);
  413. --- 2079,2091 ----
  414.   
  415.       if (index >= ListLength(self))
  416.       {
  417. !     PyErr_SET_STRING(PyExc_IndexError, "list index out of range");
  418.       return NULL;
  419.       }
  420.       li = list_find(self->list, (long) index);
  421.       if (li == NULL)
  422.       {
  423. !     PyErr_SET_VIM("internal error: failed to get vim list item");
  424.       return NULL;
  425.       }
  426.       return ConvertToPyObject(&li->li_tv);
  427. ***************
  428. *** 2196,2207 ****
  429.   
  430.       if (l->lv_lock)
  431.       {
  432. !     PyErr_SetVim(_("list is locked"));
  433.       return -1;
  434.       }
  435.       if (index>length || (index==length && obj==NULL))
  436.       {
  437. !     PyErr_SetString(PyExc_IndexError, _("list index out of range"));
  438.       return -1;
  439.       }
  440.   
  441. --- 2198,2209 ----
  442.   
  443.       if (l->lv_lock)
  444.       {
  445. !     PyErr_SET_VIM("list is locked");
  446.       return -1;
  447.       }
  448.       if (index>length || (index==length && obj==NULL))
  449.       {
  450. !     PyErr_SET_STRING(PyExc_IndexError, "list index out of range");
  451.       return -1;
  452.       }
  453.   
  454. ***************
  455. *** 2222,2228 ****
  456.       if (list_append_tv(l, &tv) == FAIL)
  457.       {
  458.           clear_tv(&tv);
  459. !         PyErr_SetVim(_("failed to add item to list"));
  460.           return -1;
  461.       }
  462.       }
  463. --- 2224,2230 ----
  464.       if (list_append_tv(l, &tv) == FAIL)
  465.       {
  466.           clear_tv(&tv);
  467. !         PyErr_SET_VIM("failed to add item to list");
  468.           return -1;
  469.       }
  470.       }
  471. ***************
  472. *** 2250,2256 ****
  473.   
  474.       if (l->lv_lock)
  475.       {
  476. !     PyErr_SetVim(_("list is locked"));
  477.       return -1;
  478.       }
  479.   
  480. --- 2252,2258 ----
  481.   
  482.       if (l->lv_lock)
  483.       {
  484. !     PyErr_SET_VIM("list is locked");
  485.       return -1;
  486.       }
  487.   
  488. ***************
  489. *** 2263,2269 ****
  490.       li = list_find(l, (long) first);
  491.       if (li == NULL)
  492.       {
  493. !         PyErr_SetVim(_("internal error: no vim list item"));
  494.           return -1;
  495.       }
  496.       if (last > first)
  497. --- 2265,2271 ----
  498.       li = list_find(l, (long) first);
  499.       if (li == NULL)
  500.       {
  501. !         PyErr_SET_VIM("internal error: no vim list item");
  502.           return -1;
  503.       }
  504.       if (last > first)
  505. ***************
  506. *** 2296,2302 ****
  507.       if (list_insert_tv(l, &v, li) == FAIL)
  508.       {
  509.           clear_tv(&v);
  510. !         PyErr_SetVim(_("internal error: failed to add item to list"));
  511.           return -1;
  512.       }
  513.       clear_tv(&v);
  514. --- 2298,2304 ----
  515.       if (list_insert_tv(l, &v, li) == FAIL)
  516.       {
  517.           clear_tv(&v);
  518. !         PyErr_SET_VIM("internal error: failed to add item to list");
  519.           return -1;
  520.       }
  521.       clear_tv(&v);
  522. ***************
  523. *** 2313,2319 ****
  524.   
  525.       if (l->lv_lock)
  526.       {
  527. !     PyErr_SetVim(_("list is locked"));
  528.       return NULL;
  529.       }
  530.   
  531. --- 2315,2321 ----
  532.   
  533.       if (l->lv_lock)
  534.       {
  535. !     PyErr_SET_VIM("list is locked");
  536.       return NULL;
  537.       }
  538.   
  539. ***************
  540. *** 2347,2354 ****
  541.   {
  542.       if (val == NULL)
  543.       {
  544. !     PyErr_SetString(PyExc_AttributeError,
  545. !         _("cannot delete vim.List attributes"));
  546.       return -1;
  547.       }
  548.   
  549. --- 2349,2356 ----
  550.   {
  551.       if (val == NULL)
  552.       {
  553. !     PyErr_SET_STRING(PyExc_AttributeError,
  554. !         "cannot delete vim.List attributes");
  555.       return -1;
  556.       }
  557.   
  558. ***************
  559. *** 2356,2362 ****
  560.       {
  561.       if (self->list->lv_lock == VAR_FIXED)
  562.       {
  563. !         PyErr_SetString(PyExc_TypeError, _("cannot modify fixed list"));
  564.           return -1;
  565.       }
  566.       else
  567. --- 2358,2364 ----
  568.       {
  569.       if (self->list->lv_lock == VAR_FIXED)
  570.       {
  571. !         PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed list");
  572.           return -1;
  573.       }
  574.       else
  575. ***************
  576. *** 2373,2379 ****
  577.       }
  578.       else
  579.       {
  580. !     PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute"));
  581.       return -1;
  582.       }
  583.   }
  584. --- 2375,2381 ----
  585.       }
  586.       else
  587.       {
  588. !     PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute");
  589.       return -1;
  590.       }
  591.   }
  592. ***************
  593. *** 2408,2415 ****
  594.       {
  595.       if (!translated_function_exists(name))
  596.       {
  597. !         PyErr_SetString(PyExc_ValueError,
  598. !             _("unnamed function does not exist"));
  599.           return NULL;
  600.       }
  601.       self->name = vim_strsave(name);
  602. --- 2410,2417 ----
  603.       {
  604.       if (!translated_function_exists(name))
  605.       {
  606. !         PyErr_SET_STRING(PyExc_ValueError,
  607. !             "unnamed function does not exist");
  608.           return NULL;
  609.       }
  610.       self->name = vim_strsave(name);
  611. ***************
  612. *** 2420,2426 ****
  613.                       vim_strchr(name, AUTOLOAD_CHAR) == NULL))
  614.           == NULL)
  615.       {
  616. !         PyErr_SetString(PyExc_ValueError, _("function does not exist"));
  617.           return NULL;
  618.       }
  619.   
  620. --- 2422,2428 ----
  621.                       vim_strchr(name, AUTOLOAD_CHAR) == NULL))
  622.           == NULL)
  623.       {
  624. !         PyErr_SET_STRING(PyExc_ValueError, "function does not exist");
  625.           return NULL;
  626.       }
  627.   
  628. ***************
  629. *** 2435,2442 ****
  630.   
  631.       if (kwargs)
  632.       {
  633. !     PyErr_SetString(PyExc_TypeError,
  634. !         _("function constructor does not accept keyword arguments"));
  635.       return NULL;
  636.       }
  637.   
  638. --- 2437,2444 ----
  639.   
  640.       if (kwargs)
  641.       {
  642. !     PyErr_SET_STRING(PyExc_TypeError,
  643. !         "function constructor does not accept keyword arguments");
  644.       return NULL;
  645.       }
  646.   
  647. ***************
  648. *** 2513,2519 ****
  649.       else if (error != OK)
  650.       {
  651.       result = NULL;
  652. !     PyErr_SetVim(_("failed to run function"));
  653.       }
  654.       else
  655.       result = ConvertToPyObject(&rettv);
  656. --- 2515,2521 ----
  657.       else if (error != OK)
  658.       {
  659.       result = NULL;
  660. !     PyErr_SET_VIM("failed to run function");
  661.       }
  662.       else
  663.       result = ConvertToPyObject(&rettv);
  664. ***************
  665. *** 2658,2671 ****
  666.       }
  667.       else
  668.       {
  669. !         PyErr_SetString(PyExc_RuntimeError,
  670. !             _("unable to get option value"));
  671.           return NULL;
  672.       }
  673.       }
  674.       else
  675.       {
  676. !     PyErr_SetVim("Internal error: unknown option type. Should not happen");
  677.       return NULL;
  678.       }
  679.   }
  680. --- 2660,2673 ----
  681.       }
  682.       else
  683.       {
  684. !         PyErr_SET_STRING(PyExc_RuntimeError,
  685. !             "unable to get option value");
  686.           return NULL;
  687.       }
  688.       }
  689.       else
  690.       {
  691. !     PyErr_SET_VIM("internal error: unknown option type");
  692.       return NULL;
  693.       }
  694.   }
  695. ***************
  696. *** 2708,2714 ****
  697.           {
  698.           if (VimTryEnd())
  699.               return -1;
  700. !         PyErr_SetVim("Problem while switching windows.");
  701.           return -1;
  702.           }
  703.           r = set_option_value_err(key, numval, stringval, opt_flags);
  704. --- 2710,2716 ----
  705.           {
  706.           if (VimTryEnd())
  707.               return -1;
  708. !         PyErr_SET_VIM("problem while switching windows");
  709.           return -1;
  710.           }
  711.           r = set_option_value_err(key, numval, stringval, opt_flags);
  712. ***************
  713. *** 2768,2782 ****
  714.       {
  715.       if (self->opt_type == SREQ_GLOBAL)
  716.       {
  717. !         PyErr_SetString(PyExc_ValueError,
  718. !             _("unable to unset global option"));
  719.           Py_XDECREF(todecref);
  720.           return -1;
  721.       }
  722.       else if (!(flags & SOPT_GLOBAL))
  723.       {
  724. !         PyErr_SetString(PyExc_ValueError, _("unable to unset option "
  725. !                         "without global value"));
  726.           Py_XDECREF(todecref);
  727.           return -1;
  728.       }
  729. --- 2770,2783 ----
  730.       {
  731.       if (self->opt_type == SREQ_GLOBAL)
  732.       {
  733. !         PyErr_SET_STRING(PyExc_ValueError, "unable to unset global option");
  734.           Py_XDECREF(todecref);
  735.           return -1;
  736.       }
  737.       else if (!(flags & SOPT_GLOBAL))
  738.       {
  739. !         PyErr_SET_STRING(PyExc_ValueError, "unable to unset option "
  740. !                            "without global value");
  741.           Py_XDECREF(todecref);
  742.           return -1;
  743.       }
  744. ***************
  745. *** 2813,2819 ****
  746.           val = PyLong_AsLong(valObject);
  747.       else
  748.       {
  749. !         PyErr_SetString(PyExc_TypeError, _("object must be integer"));
  750.           Py_XDECREF(todecref);
  751.           return -1;
  752.       }
  753. --- 2814,2820 ----
  754.           val = PyLong_AsLong(valObject);
  755.       else
  756.       {
  757. !         PyErr_SET_STRING(PyExc_TypeError, "object must be integer");
  758.           Py_XDECREF(todecref);
  759.           return -1;
  760.       }
  761. ***************
  762. *** 2862,2868 ****
  763.   {
  764.       if (self->tab == INVALID_TABPAGE_VALUE)
  765.       {
  766. !     PyErr_SetVim(_("attempt to refer to deleted tab page"));
  767.       return -1;
  768.       }
  769.   
  770. --- 2863,2869 ----
  771.   {
  772.       if (self->tab == INVALID_TABPAGE_VALUE)
  773.       {
  774. !     PyErr_SET_VIM("attempt to refer to deleted tab page");
  775.       return -1;
  776.       }
  777.   
  778. ***************
  779. *** 3006,3012 ****
  780.       if (n == 0)
  781.           return TabPageNew(tp);
  782.   
  783. !     PyErr_SetString(PyExc_IndexError, _("no such tab page"));
  784.       return NULL;
  785.   }
  786.   
  787. --- 3007,3013 ----
  788.       if (n == 0)
  789.           return TabPageNew(tp);
  790.   
  791. !     PyErr_SET_STRING(PyExc_IndexError, "no such tab page");
  792.       return NULL;
  793.   }
  794.   
  795. ***************
  796. *** 3028,3034 ****
  797.   {
  798.       if (self->win == INVALID_WINDOW_VALUE)
  799.       {
  800. !     PyErr_SetVim(_("attempt to refer to deleted window"));
  801.       return -1;
  802.       }
  803.   
  804. --- 3029,3035 ----
  805.   {
  806.       if (self->win == INVALID_WINDOW_VALUE)
  807.       {
  808. !     PyErr_SET_VIM("attempt to refer to deleted window");
  809.       return -1;
  810.       }
  811.   
  812. ***************
  813. *** 3194,3200 ****
  814.   
  815.       if (strcmp(name, "buffer") == 0)
  816.       {
  817. !     PyErr_SetString(PyExc_TypeError, _("readonly attribute"));
  818.       return -1;
  819.       }
  820.       else if (strcmp(name, "cursor") == 0)
  821. --- 3195,3201 ----
  822.   
  823.       if (strcmp(name, "buffer") == 0)
  824.       {
  825. !     PyErr_SET_STRING(PyExc_TypeError, "readonly attribute");
  826.       return -1;
  827.       }
  828.       else if (strcmp(name, "cursor") == 0)
  829. ***************
  830. *** 3207,3213 ****
  831.   
  832.       if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count)
  833.       {
  834. !         PyErr_SetVim(_("cursor position outside buffer"));
  835.           return -1;
  836.       }
  837.   
  838. --- 3208,3214 ----
  839.   
  840.       if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count)
  841.       {
  842. !         PyErr_SET_VIM("cursor position outside buffer");
  843.           return -1;
  844.       }
  845.   
  846. ***************
  847. *** 3370,3376 ****
  848.       if (n == 0)
  849.           return WindowNew(w, self->tabObject? self->tabObject->tab: curtab);
  850.   
  851. !     PyErr_SetString(PyExc_IndexError, _("no such window"));
  852.       return NULL;
  853.   }
  854.   
  855. --- 3371,3377 ----
  856.       if (n == 0)
  857.           return WindowNew(w, self->tabObject? self->tabObject->tab: curtab);
  858.   
  859. !     PyErr_SET_STRING(PyExc_IndexError, "no such window");
  860.       return NULL;
  861.   }
  862.   
  863. ***************
  864. *** 3424,3430 ****
  865.           --len;
  866.       else
  867.       {
  868. !         PyErr_SetVim(_("string cannot contain newlines"));
  869.           return NULL;
  870.       }
  871.       }
  872. --- 3425,3431 ----
  873.           --len;
  874.       else
  875.       {
  876. !         PyErr_SET_VIM("string cannot contain newlines");
  877.           return NULL;
  878.       }
  879.       }
  880. ***************
  881. *** 3557,3565 ****
  882.       VimTryStart();
  883.   
  884.       if (u_savedel((linenr_T)n, 1L) == FAIL)
  885. !         PyErr_SetVim(_("cannot save undo information"));
  886.       else if (ml_delete((linenr_T)n, FALSE) == FAIL)
  887. !         PyErr_SetVim(_("cannot delete line"));
  888.       else
  889.       {
  890.           if (buf == savebuf)
  891. --- 3558,3566 ----
  892.       VimTryStart();
  893.   
  894.       if (u_savedel((linenr_T)n, 1L) == FAIL)
  895. !         PyErr_SET_VIM("cannot save undo information");
  896.       else if (ml_delete((linenr_T)n, FALSE) == FAIL)
  897. !         PyErr_SET_VIM("cannot delete line");
  898.       else
  899.       {
  900.           if (buf == savebuf)
  901. ***************
  902. *** 3593,3604 ****
  903.   
  904.       if (u_savesub((linenr_T)n) == FAIL)
  905.       {
  906. !         PyErr_SetVim(_("cannot save undo information"));
  907.           vim_free(save);
  908.       }
  909.       else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL)
  910.       {
  911. !         PyErr_SetVim(_("cannot replace line"));
  912.           vim_free(save);
  913.       }
  914.       else
  915. --- 3594,3605 ----
  916.   
  917.       if (u_savesub((linenr_T)n) == FAIL)
  918.       {
  919. !         PyErr_SET_VIM("cannot save undo information");
  920.           vim_free(save);
  921.       }
  922.       else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL)
  923.       {
  924. !         PyErr_SET_VIM("cannot replace line");
  925.           vim_free(save);
  926.       }
  927.       else
  928. ***************
  929. *** 3653,3666 ****
  930.       switch_buffer(&savebuf, buf);
  931.   
  932.       if (u_savedel((linenr_T)lo, (long)n) == FAIL)
  933. !         PyErr_SetVim(_("cannot save undo information"));
  934.       else
  935.       {
  936.           for (i = 0; i < n; ++i)
  937.           {
  938.           if (ml_delete((linenr_T)lo, FALSE) == FAIL)
  939.           {
  940. !             PyErr_SetVim(_("cannot delete line"));
  941.               break;
  942.           }
  943.           }
  944. --- 3654,3667 ----
  945.       switch_buffer(&savebuf, buf);
  946.   
  947.       if (u_savedel((linenr_T)lo, (long)n) == FAIL)
  948. !         PyErr_SET_VIM("cannot save undo information");
  949.       else
  950.       {
  951.           for (i = 0; i < n; ++i)
  952.           {
  953.           if (ml_delete((linenr_T)lo, FALSE) == FAIL)
  954.           {
  955. !             PyErr_SET_VIM("cannot delete line");
  956.               break;
  957.           }
  958.           }
  959. ***************
  960. *** 3721,3727 ****
  961.       switch_buffer(&savebuf, buf);
  962.   
  963.       if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
  964. !         PyErr_SetVim(_("cannot save undo information"));
  965.   
  966.       /* If the size of the range is reducing (ie, new_len < old_len) we
  967.        * need to delete some old_len. We do this at the start, by
  968. --- 3722,3728 ----
  969.       switch_buffer(&savebuf, buf);
  970.   
  971.       if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
  972. !         PyErr_SET_VIM("cannot save undo information");
  973.   
  974.       /* If the size of the range is reducing (ie, new_len < old_len) we
  975.        * need to delete some old_len. We do this at the start, by
  976. ***************
  977. *** 3732,3738 ****
  978.           for (i = 0; i < old_len - new_len; ++i)
  979.           if (ml_delete((linenr_T)lo, FALSE) == FAIL)
  980.           {
  981. !             PyErr_SetVim(_("cannot delete line"));
  982.               break;
  983.           }
  984.           extra -= i;
  985. --- 3733,3739 ----
  986.           for (i = 0; i < old_len - new_len; ++i)
  987.           if (ml_delete((linenr_T)lo, FALSE) == FAIL)
  988.           {
  989. !             PyErr_SET_VIM("cannot delete line");
  990.               break;
  991.           }
  992.           extra -= i;
  993. ***************
  994. *** 3748,3754 ****
  995.           if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE)
  996.                                         == FAIL)
  997.           {
  998. !             PyErr_SetVim(_("cannot replace line"));
  999.               break;
  1000.           }
  1001.       }
  1002. --- 3749,3755 ----
  1003.           if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE)
  1004.                                         == FAIL)
  1005.           {
  1006. !             PyErr_SET_VIM("cannot replace line");
  1007.               break;
  1008.           }
  1009.       }
  1010. ***************
  1011. *** 3766,3772 ****
  1012.           if (ml_append((linenr_T)(lo + i - 1),
  1013.                       (char_u *)array[i], 0, FALSE) == FAIL)
  1014.           {
  1015. !             PyErr_SetVim(_("cannot insert line"));
  1016.               break;
  1017.           }
  1018.           vim_free(array[i]);
  1019. --- 3767,3773 ----
  1020.           if (ml_append((linenr_T)(lo + i - 1),
  1021.                       (char_u *)array[i], 0, FALSE) == FAIL)
  1022.           {
  1023. !             PyErr_SET_VIM("cannot insert line");
  1024.               break;
  1025.           }
  1026.           vim_free(array[i]);
  1027. ***************
  1028. *** 3843,3851 ****
  1029.       switch_buffer(&savebuf, buf);
  1030.   
  1031.       if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
  1032. !         PyErr_SetVim(_("cannot save undo information"));
  1033.       else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
  1034. !         PyErr_SetVim(_("cannot insert line"));
  1035.       else
  1036.           appended_lines_mark((linenr_T)n, 1L);
  1037.   
  1038. --- 3844,3852 ----
  1039.       switch_buffer(&savebuf, buf);
  1040.   
  1041.       if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
  1042. !         PyErr_SET_VIM("cannot save undo information");
  1043.       else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL)
  1044. !         PyErr_SET_VIM("cannot insert line");
  1045.       else
  1046.           appended_lines_mark((linenr_T)n, 1L);
  1047.   
  1048. ***************
  1049. *** 3894,3900 ****
  1050.       switch_buffer(&savebuf, buf);
  1051.   
  1052.       if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
  1053. !         PyErr_SetVim(_("cannot save undo information"));
  1054.       else
  1055.       {
  1056.           for (i = 0; i < size; ++i)
  1057. --- 3895,3901 ----
  1058.       switch_buffer(&savebuf, buf);
  1059.   
  1060.       if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
  1061. !         PyErr_SET_VIM("cannot save undo information");
  1062.       else
  1063.       {
  1064.           for (i = 0; i < size; ++i)
  1065. ***************
  1066. *** 3902,3908 ****
  1067.           if (ml_append((linenr_T)(n + i),
  1068.                       (char_u *)array[i], 0, FALSE) == FAIL)
  1069.           {
  1070. !             PyErr_SetVim(_("cannot insert line"));
  1071.   
  1072.               /* Free the rest of the lines */
  1073.               while (i < size)
  1074. --- 3903,3909 ----
  1075.           if (ml_append((linenr_T)(n + i),
  1076.                       (char_u *)array[i], 0, FALSE) == FAIL)
  1077.           {
  1078. !             PyErr_SET_VIM("cannot insert line");
  1079.   
  1080.               /* Free the rest of the lines */
  1081.               while (i < size)
  1082. ***************
  1083. *** 3955,3961 ****
  1084.   {
  1085.       if (self->buf == INVALID_BUFFER_VALUE)
  1086.       {
  1087. !     PyErr_SetVim(_("attempt to refer to deleted buffer"));
  1088.       return -1;
  1089.       }
  1090.   
  1091. --- 3956,3962 ----
  1092.   {
  1093.       if (self->buf == INVALID_BUFFER_VALUE)
  1094.       {
  1095. !     PyErr_SET_VIM("attempt to refer to deleted buffer");
  1096.       return -1;
  1097.       }
  1098.   
  1099. ***************
  1100. *** 3976,3982 ****
  1101.   
  1102.       if (n < 0 || n > end - start)
  1103.       {
  1104. !     PyErr_SetString(PyExc_IndexError, _("line number out of range"));
  1105.       return NULL;
  1106.       }
  1107.   
  1108. --- 3977,3983 ----
  1109.   
  1110.       if (n < 0 || n > end - start)
  1111.       {
  1112. !     PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
  1113.       return NULL;
  1114.       }
  1115.   
  1116. ***************
  1117. *** 4026,4032 ****
  1118.   
  1119.       if (n < 0 || n > end - start)
  1120.       {
  1121. !     PyErr_SetString(PyExc_IndexError, _("line number out of range"));
  1122.       return -1;
  1123.       }
  1124.   
  1125. --- 4027,4033 ----
  1126.   
  1127.       if (n < 0 || n > end - start)
  1128.       {
  1129. !     PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
  1130.       return -1;
  1131.       }
  1132.   
  1133. ***************
  1134. *** 4098,4104 ****
  1135.   
  1136.       if (n < 0 || n > max)
  1137.       {
  1138. !     PyErr_SetString(PyExc_IndexError, _("line number out of range"));
  1139.       return NULL;
  1140.       }
  1141.   
  1142. --- 4099,4105 ----
  1143.   
  1144.       if (n < 0 || n > max)
  1145.       {
  1146. !     PyErr_SET_STRING(PyExc_IndexError, "line number out of range");
  1147.       return NULL;
  1148.       }
  1149.   
  1150. ***************
  1151. *** 4381,4387 ****
  1152.   
  1153.       if (r == FAIL)
  1154.       {
  1155. !         PyErr_SetVim(_("failed to rename buffer"));
  1156.           return -1;
  1157.       }
  1158.       return 0;
  1159. --- 4382,4388 ----
  1160.   
  1161.       if (r == FAIL)
  1162.       {
  1163. !         PyErr_SET_VIM("failed to rename buffer");
  1164.           return -1;
  1165.       }
  1166.       return 0;
  1167. ***************
  1168. *** 4416,4423 ****
  1169.   
  1170.       if (pmark[0] == '\0' || pmark[1] != '\0')
  1171.       {
  1172. !     PyErr_SetString(PyExc_ValueError,
  1173. !         _("mark name must be a single character"));
  1174.       return NULL;
  1175.       }
  1176.   
  1177. --- 4417,4424 ----
  1178.   
  1179.       if (pmark[0] == '\0' || pmark[1] != '\0')
  1180.       {
  1181. !     PyErr_SET_STRING(PyExc_ValueError,
  1182. !         "mark name must be a single character");
  1183.       return NULL;
  1184.       }
  1185.   
  1186. ***************
  1187. *** 4434,4440 ****
  1188.   
  1189.       if (posp == NULL)
  1190.       {
  1191. !     PyErr_SetVim(_("invalid mark name"));
  1192.       return NULL;
  1193.       }
  1194.   
  1195. --- 4435,4441 ----
  1196.   
  1197.       if (posp == NULL)
  1198.       {
  1199. !     PyErr_SET_VIM("invalid mark name");
  1200.       return NULL;
  1201.       }
  1202.   
  1203. ***************
  1204. *** 4529,4535 ****
  1205.       bnr = PyLong_AsLong(keyObject);
  1206.       else
  1207.       {
  1208. !     PyErr_SetString(PyExc_TypeError, _("key must be integer"));
  1209.       return NULL;
  1210.       }
  1211.   
  1212. --- 4530,4536 ----
  1213.       bnr = PyLong_AsLong(keyObject);
  1214.       else
  1215.       {
  1216. !     PyErr_SET_STRING(PyExc_TypeError, "key must be integer");
  1217.       return NULL;
  1218.       }
  1219.   
  1220. ***************
  1221. *** 4667,4673 ****
  1222.   
  1223.       if (value->ob_type != &BufferType)
  1224.       {
  1225. !         PyErr_SetString(PyExc_TypeError, _("expected vim.Buffer object"));
  1226.           return -1;
  1227.       }
  1228.   
  1229. --- 4668,4674 ----
  1230.   
  1231.       if (value->ob_type != &BufferType)
  1232.       {
  1233. !         PyErr_SET_STRING(PyExc_TypeError, "expected vim.Buffer object");
  1234.           return -1;
  1235.       }
  1236.   
  1237. ***************
  1238. *** 4680,4686 ****
  1239.       {
  1240.           if (VimTryEnd())
  1241.           return -1;
  1242. !         PyErr_SetVim(_("failed to switch to given buffer"));
  1243.           return -1;
  1244.       }
  1245.   
  1246. --- 4681,4687 ----
  1247.       {
  1248.           if (VimTryEnd())
  1249.           return -1;
  1250. !         PyErr_SET_VIM("failed to switch to given buffer");
  1251.           return -1;
  1252.       }
  1253.   
  1254. ***************
  1255. *** 4692,4698 ****
  1256.   
  1257.       if (value->ob_type != &WindowType)
  1258.       {
  1259. !         PyErr_SetString(PyExc_TypeError, _("expected vim.Window object"));
  1260.           return -1;
  1261.       }
  1262.   
  1263. --- 4693,4699 ----
  1264.   
  1265.       if (value->ob_type != &WindowType)
  1266.       {
  1267. !         PyErr_SET_STRING(PyExc_TypeError, "expected vim.Window object");
  1268.           return -1;
  1269.       }
  1270.   
  1271. ***************
  1272. *** 4702,4709 ****
  1273.   
  1274.       if (!count)
  1275.       {
  1276. !         PyErr_SetString(PyExc_ValueError,
  1277. !             _("failed to find window in the current tab page"));
  1278.           return -1;
  1279.       }
  1280.   
  1281. --- 4703,4710 ----
  1282.   
  1283.       if (!count)
  1284.       {
  1285. !         PyErr_SET_STRING(PyExc_ValueError,
  1286. !             "failed to find window in the current tab page");
  1287.           return -1;
  1288.       }
  1289.   
  1290. ***************
  1291. *** 4713,4720 ****
  1292.       {
  1293.           if (VimTryEnd())
  1294.           return -1;
  1295. !         PyErr_SetString(PyExc_RuntimeError,
  1296. !             _("did not switch to the specified window"));
  1297.           return -1;
  1298.       }
  1299.   
  1300. --- 4714,4721 ----
  1301.       {
  1302.           if (VimTryEnd())
  1303.           return -1;
  1304. !         PyErr_SET_STRING(PyExc_RuntimeError,
  1305. !             "did not switch to the specified window");
  1306.           return -1;
  1307.       }
  1308.   
  1309. ***************
  1310. *** 4724,4730 ****
  1311.       {
  1312.       if (value->ob_type != &TabPageType)
  1313.       {
  1314. !         PyErr_SetString(PyExc_TypeError, _("expected vim.TabPage object"));
  1315.           return -1;
  1316.       }
  1317.   
  1318. --- 4725,4731 ----
  1319.       {
  1320.       if (value->ob_type != &TabPageType)
  1321.       {
  1322. !         PyErr_SET_STRING(PyExc_TypeError, "expected vim.TabPage object");
  1323.           return -1;
  1324.       }
  1325.   
  1326. ***************
  1327. *** 4737,4744 ****
  1328.       {
  1329.           if (VimTryEnd())
  1330.           return -1;
  1331. !         PyErr_SetString(PyExc_RuntimeError,
  1332. !             _("did not switch to the specified tab page"));
  1333.           return -1;
  1334.       }
  1335.   
  1336. --- 4738,4745 ----
  1337.       {
  1338.           if (VimTryEnd())
  1339.           return -1;
  1340. !         PyErr_SET_STRING(PyExc_RuntimeError,
  1341. !             "did not switch to the specified tab page");
  1342.           return -1;
  1343.       }
  1344.   
  1345. ***************
  1346. *** 5005,5011 ****
  1347.           clear_tv(&di->di_tv);
  1348.           vim_free(di);
  1349.           dict_unref(dict);
  1350. !         PyErr_SetVim(_("failed to add key to dictionary"));
  1351.           return -1;
  1352.       }
  1353.       }
  1354. --- 5006,5012 ----
  1355.           clear_tv(&di->di_tv);
  1356.           vim_free(di);
  1357.           dict_unref(dict);
  1358. !         PyErr_SET_VIM("failed to add key to dictionary");
  1359.           return -1;
  1360.       }
  1361.       }
  1362. ***************
  1363. *** 5107,5113 ****
  1364.           Py_DECREF(iterator);
  1365.           dictitem_free(di);
  1366.           dict_unref(dict);
  1367. !         PyErr_SetVim(_("failed to add key to dictionary"));
  1368.           return -1;
  1369.       }
  1370.       }
  1371. --- 5108,5114 ----
  1372.           Py_DECREF(iterator);
  1373.           dictitem_free(di);
  1374.           dict_unref(dict);
  1375. !         PyErr_SET_VIM("failed to add key to dictionary");
  1376.           return -1;
  1377.       }
  1378.       }
  1379. ***************
  1380. *** 5215,5222 ****
  1381.       r = convert_dl(obj, tv, pymap_to_tv, lookup_dict);
  1382.       else
  1383.       {
  1384. !     PyErr_SetString(PyExc_TypeError,
  1385. !         _("unable to convert object to vim dictionary"));
  1386.       r = -1;
  1387.       }
  1388.       Py_DECREF(lookup_dict);
  1389. --- 5216,5223 ----
  1390.       r = convert_dl(obj, tv, pymap_to_tv, lookup_dict);
  1391.       else
  1392.       {
  1393. !     PyErr_SET_STRING(PyExc_TypeError,
  1394. !         "unable to convert object to vim dictionary");
  1395.       r = -1;
  1396.       }
  1397.       Py_DECREF(lookup_dict);
  1398. ***************
  1399. *** 5325,5332 ****
  1400.       return convert_dl(obj, tv, pymap_to_tv, lookup_dict);
  1401.       else
  1402.       {
  1403. !     PyErr_SetString(PyExc_TypeError,
  1404. !         _("unable to convert to vim structure"));
  1405.       return -1;
  1406.       }
  1407.       return 0;
  1408. --- 5326,5333 ----
  1409.       return convert_dl(obj, tv, pymap_to_tv, lookup_dict);
  1410.       else
  1411.       {
  1412. !     PyErr_SET_STRING(PyExc_TypeError,
  1413. !         "unable to convert to vim structure");
  1414.       return -1;
  1415.       }
  1416.       return 0;
  1417. ***************
  1418. *** 5337,5343 ****
  1419.   {
  1420.       if (tv == NULL)
  1421.       {
  1422. !     PyErr_SetVim(_("NULL reference passed"));
  1423.       return NULL;
  1424.       }
  1425.       switch (tv->v_type)
  1426. --- 5338,5344 ----
  1427.   {
  1428.       if (tv == NULL)
  1429.       {
  1430. !     PyErr_SET_VIM("NULL reference passed");
  1431.       return NULL;
  1432.       }
  1433.       switch (tv->v_type)
  1434. ***************
  1435. *** 5362,5368 ****
  1436.           Py_INCREF(Py_None);
  1437.           return Py_None;
  1438.       default:
  1439. !         PyErr_SetVim(_("internal error: invalid value type"));
  1440.           return NULL;
  1441.       }
  1442.   }
  1443. --- 5363,5369 ----
  1444.           Py_INCREF(Py_None);
  1445.           return Py_None;
  1446.       default:
  1447. !         PyErr_SET_VIM("internal error: invalid value type");
  1448.           return NULL;
  1449.       }
  1450.   }
  1451. *** ../vim-7.3.1228/src/if_python3.c    2013-06-23 13:11:14.000000000 +0200
  1452. --- src/if_python3.c    2013-06-23 13:25:51.000000000 +0200
  1453. ***************
  1454. *** 1169,1175 ****
  1455.       }
  1456.       else
  1457.       {
  1458. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1459.       return NULL;
  1460.       }
  1461.   }
  1462. --- 1169,1175 ----
  1463.       }
  1464.       else
  1465.       {
  1466. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1467.       return NULL;
  1468.       }
  1469.   }
  1470. ***************
  1471. *** 1203,1209 ****
  1472.       }
  1473.       else
  1474.       {
  1475. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1476.       return -1;
  1477.       }
  1478.   }
  1479. --- 1203,1209 ----
  1480.       }
  1481.       else
  1482.       {
  1483. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1484.       return -1;
  1485.       }
  1486.   }
  1487. ***************
  1488. *** 1285,1291 ****
  1489.       }
  1490.       else
  1491.       {
  1492. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1493.       return NULL;
  1494.       }
  1495.   }
  1496. --- 1285,1291 ----
  1497.       }
  1498.       else
  1499.       {
  1500. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1501.       return NULL;
  1502.       }
  1503.   }
  1504. ***************
  1505. *** 1312,1318 ****
  1506.       }
  1507.       else
  1508.       {
  1509. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1510.       return -1;
  1511.       }
  1512.   }
  1513. --- 1312,1318 ----
  1514.       }
  1515.       else
  1516.       {
  1517. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1518.       return -1;
  1519.       }
  1520.   }
  1521. ***************
  1522. *** 1491,1497 ****
  1523.       }
  1524.       else
  1525.       {
  1526. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1527.       return NULL;
  1528.       }
  1529.   }
  1530. --- 1491,1497 ----
  1531.       }
  1532.       else
  1533.       {
  1534. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1535.       return NULL;
  1536.       }
  1537.   }
  1538. ***************
  1539. *** 1515,1521 ****
  1540.       }
  1541.       else
  1542.       {
  1543. !     PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
  1544.       return -1;
  1545.       }
  1546.   }
  1547. --- 1515,1521 ----
  1548.       }
  1549.       else
  1550.       {
  1551. !     PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice");
  1552.       return -1;
  1553.       }
  1554.   }
  1555. *** ../vim-7.3.1228/src/version.c    2013-06-23 13:11:14.000000000 +0200
  1556. --- src/version.c    2013-06-23 13:12:35.000000000 +0200
  1557. ***************
  1558. *** 730,731 ****
  1559. --- 730,733 ----
  1560.   {   /* Add new patch number below this line */
  1561. + /**/
  1562. +     1229,
  1563.   /**/
  1564.  
  1565. -- 
  1566. There is a fine line between courage and foolishness.
  1567. Unfortunately, it's not a fence.
  1568.  
  1569.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  1570. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  1571. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  1572.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  1573.