if (!str_obj || PyUnicode_READY(str_obj) == -1)
return -1;
sub_obj = (PyUnicodeObject*) PyUnicode_FromObject(substr);
- if (!sub_obj || PyUnicode_READY(str_obj) == -1) {
+ if (!sub_obj || PyUnicode_READY(sub_obj) == -1) {
Py_DECREF(str_obj);
return -1;
}
if (separator == NULL) {
/* fall back to a blank space separator */
sep = PyUnicode_FromOrdinal(' ');
- if (!sep || PyUnicode_READY(sep) == -1)
+ if (!sep)
goto onError;
}
else {
Py_DECREF(uniobj);
return 0;
}
- if (PyUnicode_READY(uniobj)) {
- Py_DECREF(uniobj);
- return 0;
- }
*fillcharloc = PyUnicode_READ_CHAR(uniobj, 0);
Py_DECREF(uniobj);
return 1;
Py_ssize_t width;
Py_UCS4 fillchar = ' ';
- if (PyUnicode_READY(self) == -1)
+ if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar))
return NULL;
- if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar))
+ if (PyUnicode_READY(self) == -1)
return NULL;
if (_PyUnicode_LENGTH(self) >= width && PyUnicode_CheckExact(self)) {
return -1;
str = PyUnicode_FromObject(container);
- if (!str || PyUnicode_READY(container) == -1) {
+ if (!str || PyUnicode_READY(str) == -1) {
Py_DECREF(sub);
return -1;
}
return v;
}
- if (PyUnicode_READY(u) == -1 || PyUnicode_READY(v) == -1)
- goto onError;
-
maxchar = PyUnicode_MAX_CHAR_VALUE(u);
maxchar = Py_MAX(maxchar, PyUnicode_MAX_CHAR_VALUE(v));
PyObject *result;
self = PyUnicode_FromObject(obj);
- if (self == NULL || PyUnicode_READY(obj) == -1)
+ if (self == NULL || PyUnicode_READY(self) == -1)
return NULL;
str1 = PyUnicode_FromObject(subobj);
- if (str1 == NULL || PyUnicode_READY(obj) == -1) {
+ if (str1 == NULL || PyUnicode_READY(str1) == -1) {
Py_DECREF(self);
return NULL;
}
str2 = PyUnicode_FromObject(replobj);
- if (str2 == NULL || PyUnicode_READY(obj)) {
+ if (str2 == NULL || PyUnicode_READY(str2)) {
Py_DECREF(self);
Py_DECREF(str1);
return NULL;
if (str1 == NULL || PyUnicode_READY(str1) == -1)
return NULL;
str2 = PyUnicode_FromObject(str2);
- if (str2 == NULL || PyUnicode_READY(str1) == -1) {
+ if (str2 == NULL || PyUnicode_READY(str2) == -1) {
Py_DECREF(str1);
return NULL;
}
Py_ssize_t width;
Py_UCS4 fillchar = ' ';
- if (PyUnicode_READY(self) == -1)
+ if (!PyArg_ParseTuple(args, "n|O&:rjust", &width, convert_uc, &fillchar))
return NULL;
- if (!PyArg_ParseTuple(args, "n|O&:rjust", &width, convert_uc, &fillchar))
+ if (PyUnicode_READY(self) == -1)
return NULL;
if (_PyUnicode_LENGTH(self) >= width && PyUnicode_CheckExact(self)) {
Py_ssize_t len1, len2;
str_obj = PyUnicode_FromObject(str_in);
- if (!str_obj || PyUnicode_READY(str_in) == -1)
+ if (!str_obj || PyUnicode_READY(str_obj) == -1)
return NULL;
sep_obj = PyUnicode_FromObject(sep_in);
if (!sep_obj || PyUnicode_READY(sep_obj) == -1) {