Mercurial > vim
comparison src/if_python3.c @ 4968:b6e693e1f946 v7.3.1229
updated for version 7.3.1229
Problem: Python: not so easy to delete/restore translating.
Solution: Make macros do translation of exception messages. (ZyX)
Note: this breaks translations!
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 23 Jun 2013 13:28:17 +0200 |
parents | 620d9b59d4ed |
children | f5c822e5a0eb |
comparison
equal
deleted
inserted
replaced
4967:a567d65645b5 | 4968:b6e693e1f946 |
---|---|
1167 } | 1167 } |
1168 return BufferSlice((BufferObject *)(self), start, stop); | 1168 return BufferSlice((BufferObject *)(self), start, stop); |
1169 } | 1169 } |
1170 else | 1170 else |
1171 { | 1171 { |
1172 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1172 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1173 return NULL; | 1173 return NULL; |
1174 } | 1174 } |
1175 } | 1175 } |
1176 | 1176 |
1177 static Py_ssize_t | 1177 static Py_ssize_t |
1201 (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, | 1201 (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, |
1202 NULL); | 1202 NULL); |
1203 } | 1203 } |
1204 else | 1204 else |
1205 { | 1205 { |
1206 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1206 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1207 return -1; | 1207 return -1; |
1208 } | 1208 } |
1209 } | 1209 } |
1210 | 1210 |
1211 static PySequenceMethods RangeAsSeq = { | 1211 static PySequenceMethods RangeAsSeq = { |
1283 } | 1283 } |
1284 return RangeSlice((RangeObject *)(self), start, stop); | 1284 return RangeSlice((RangeObject *)(self), start, stop); |
1285 } | 1285 } |
1286 else | 1286 else |
1287 { | 1287 { |
1288 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1288 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1289 return NULL; | 1289 return NULL; |
1290 } | 1290 } |
1291 } | 1291 } |
1292 | 1292 |
1293 static Py_ssize_t | 1293 static Py_ssize_t |
1310 } | 1310 } |
1311 return RangeAsSlice(self, start, stop, val); | 1311 return RangeAsSlice(self, start, stop, val); |
1312 } | 1312 } |
1313 else | 1313 else |
1314 { | 1314 { |
1315 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1315 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1316 return -1; | 1316 return -1; |
1317 } | 1317 } |
1318 } | 1318 } |
1319 | 1319 |
1320 /* TabPage object - Implementation | 1320 /* TabPage object - Implementation |
1489 return NULL; | 1489 return NULL; |
1490 return ListSlice((ListObject *)(self), start, stop); | 1490 return ListSlice((ListObject *)(self), start, stop); |
1491 } | 1491 } |
1492 else | 1492 else |
1493 { | 1493 { |
1494 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1494 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1495 return NULL; | 1495 return NULL; |
1496 } | 1496 } |
1497 } | 1497 } |
1498 | 1498 |
1499 static Py_ssize_t | 1499 static Py_ssize_t |
1513 return -1; | 1513 return -1; |
1514 return ListAssSlice((ListObject *)(self), start, stop, obj); | 1514 return ListAssSlice((ListObject *)(self), start, stop, obj); |
1515 } | 1515 } |
1516 else | 1516 else |
1517 { | 1517 { |
1518 PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); | 1518 PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); |
1519 return -1; | 1519 return -1; |
1520 } | 1520 } |
1521 } | 1521 } |
1522 | 1522 |
1523 static PyObject * | 1523 static PyObject * |