diff options
Diffstat (limited to 'Objects/stringlib')
-rw-r--r-- | Objects/stringlib/codecs.h | 3 | ||||
-rw-r--r-- | Objects/stringlib/unicode_format.h | 14 |
2 files changed, 2 insertions, 15 deletions
diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index 958cc86..f98e71c 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -408,9 +408,6 @@ STRINGLIB(utf8_encoder)(_PyBytesWriter *writer, } else { /* rep is unicode */ - if (PyUnicode_READY(rep) < 0) - goto error; - if (!PyUnicode_IS_ASCII(rep)) { raise_encode_exception(&exc, "utf-8", unicode, startpos, endpos, diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h index ccd7c77..f4ba0a9 100644 --- a/Objects/stringlib/unicode_format.h +++ b/Objects/stringlib/unicode_format.h @@ -820,7 +820,7 @@ output_markup(SubString *field_name, SubString *format_spec, if (conversion != '\0') { tmp = do_conversion(fieldobj, conversion); - if (tmp == NULL || PyUnicode_READY(tmp) == -1) + if (tmp == NULL) goto done; /* do the assignment, transferring ownership: fieldobj = tmp */ @@ -832,7 +832,7 @@ output_markup(SubString *field_name, SubString *format_spec, if (format_spec_needs_expanding) { tmp = build_string(format_spec, args, kwargs, recursion_depth-1, auto_number); - if (tmp == NULL || PyUnicode_READY(tmp) == -1) + if (tmp == NULL) goto done; /* note that in the case we're expanding the format string, @@ -948,10 +948,6 @@ do_string_format(PyObject *self, PyObject *args, PyObject *kwargs) int recursion_depth = 2; AutoNumber auto_number; - - if (PyUnicode_READY(self) == -1) - return NULL; - AutoNumber_Init(&auto_number); SubString_init(&input, self, 0, PyUnicode_GET_LENGTH(self)); return build_string(&input, args, kwargs, recursion_depth, &auto_number); @@ -1110,9 +1106,6 @@ formatter_parser(PyObject *ignored, PyObject *self) return NULL; } - if (PyUnicode_READY(self) == -1) - return NULL; - it = PyObject_New(formatteriterobject, &PyFormatterIter_Type); if (it == NULL) return NULL; @@ -1252,9 +1245,6 @@ formatter_field_name_split(PyObject *ignored, PyObject *self) return NULL; } - if (PyUnicode_READY(self) == -1) - return NULL; - it = PyObject_New(fieldnameiterobject, &PyFieldNameIter_Type); if (it == NULL) return NULL; |