summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-29 22:43:37 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-29 22:43:37 +0200
commitc37b6ecd60e0ef99406aa903cc98482117f5ed7b (patch)
treecca1374cd40d7d6ccf12bdb6429f70b84a8b7c01
parentb38caae26c2d0cf6633d829a9b6014b8868da0f0 (diff)
downloadvim-git-c37b6ecd60e0ef99406aa903cc98482117f5ed7b.tar.gz
updated for version 7.3.1049v7.3.1049
Problem: Python: no consistent naming Solution: Python patch 10: Rename DICTKEY_GET_NOTEMPTY to DICTKEY_GET. (ZyX)
-rw-r--r--src/if_py_both.h27
-rw-r--r--src/version.c2
2 files changed, 14 insertions, 15 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 690749443..eae389437 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -34,7 +34,12 @@ typedef int Py_ssize_t; /* Python 2.4 and earlier don't have this type. */
PyObject *dictkey_todecref;
#define DICTKEY_GET(err) \
if (!(key = StringToChars(keyObject, &dictkey_todecref))) \
- return err;
+ return err; \
+ if (*key == NUL) \
+ { \
+ PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
+ return err; \
+ }
#define DICTKEY_UNREF \
Py_XDECREF(dictkey_todecref);
@@ -851,14 +856,6 @@ pyll_add(PyObject *self, pylinkedlist_T *ref, pylinkedlist_T **last)
static PyTypeObject DictionaryType;
-#define DICTKEY_GET_NOTEMPTY(err) \
- DICTKEY_GET(err) \
- if (*key == NUL) \
- { \
- PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
- return err; \
- }
-
typedef struct
{
PyObject_HEAD
@@ -950,7 +947,7 @@ DictionaryItem(DictionaryObject *self, PyObject *keyObject)
dictitem_T *di;
DICTKEY_DECL
- DICTKEY_GET_NOTEMPTY(NULL)
+ DICTKEY_GET(NULL)
di = dict_find(self->dict, key, -1);
@@ -980,7 +977,7 @@ DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObje
return -1;
}
- DICTKEY_GET_NOTEMPTY(-1)
+ DICTKEY_GET(-1)
di = dict_find(dict, key, -1);
@@ -1653,7 +1650,7 @@ OptionsItem(OptionsObject *self, PyObject *keyObject)
if (self->Check(self->from))
return NULL;
- DICTKEY_GET_NOTEMPTY(NULL)
+ DICTKEY_GET(NULL)
flags = get_option_value_strict(key, &numval, &stringval,
self->opt_type, self->from);
@@ -1792,7 +1789,7 @@ OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject)
if (self->Check(self->from))
return -1;
- DICTKEY_GET_NOTEMPTY(-1)
+ DICTKEY_GET(-1)
flags = get_option_value_strict(key, NULL, NULL,
self->opt_type, self->from);
@@ -4037,7 +4034,7 @@ pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
if (valObject == NULL)
return -1;
- DICTKEY_GET_NOTEMPTY(-1)
+ DICTKEY_GET(-1)
di = dictitem_alloc(key);
@@ -4111,7 +4108,7 @@ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
return -1;
}
- DICTKEY_GET_NOTEMPTY(-1)
+ DICTKEY_GET(-1)
valObject = PyTuple_GetItem(litem, 1);
if (valObject == NULL)
diff --git a/src/version.c b/src/version.c
index 1ce44546f..13a0ec2f4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1049,
+/**/
1048,
/**/
1047,