flags = get_option_value_strict(key, NULL, NULL,
self->opt_type, self->from);
- DICTKEY_UNREF
-
if (flags == 0)
{
PyErr_SetObject(PyExc_KeyError, keyObject);
+ DICTKEY_UNREF
return -1;
}
{
PyErr_SetString(PyExc_ValueError,
_("unable to unset global option"));
+ DICTKEY_UNREF
return -1;
}
else if (!(flags & SOPT_GLOBAL))
{
PyErr_SetString(PyExc_ValueError, _("unable to unset option "
"without global value"));
+ DICTKEY_UNREF
return -1;
}
else
{
unset_global_local_option(key, self->from);
+ DICTKEY_UNREF
return 0;
}
}
int istrue = PyObject_IsTrue(valObject);
if (istrue == -1)
- return -1;
- r = set_option_value_for(key, istrue, NULL,
- opt_flags, self->opt_type, self->from);
+ r = -1;
+ else
+ r = set_option_value_for(key, istrue, NULL,
+ opt_flags, self->opt_type, self->from);
}
else if (flags & SOPT_NUM)
{
else
{
PyErr_SetString(PyExc_TypeError, _("object must be integer"));
+ DICTKEY_UNREF
return -1;
}
{
if (PyString_AsStringAndSize(valObject, (char **) &val, NULL) == -1)
+ {
+ DICTKEY_UNREF
return -1;
+ }
if (val == NULL)
+ {
+ DICTKEY_UNREF
return -1;
+ }
val = vim_strsave(val);
}
bytes = PyUnicode_AsEncodedString(valObject, (char *)ENC_OPT, NULL);
if (bytes == NULL)
+ {
+ DICTKEY_UNREF
return -1;
+ }
if(PyString_AsStringAndSize(bytes, (char **) &val, NULL) == -1)
+ {
+ DICTKEY_UNREF
return -1;
+ }
if (val == NULL)
+ {
+ DICTKEY_UNREF
return -1;
+ }
val = vim_strsave(val);
Py_XDECREF(bytes);
else
{
PyErr_SetString(PyExc_TypeError, _("object must be string"));
+ DICTKEY_UNREF
return -1;
}
vim_free(val);
}
+ DICTKEY_UNREF
+
return r;
}