diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytesobject.c | 2 | ||||
-rw-r--r-- | Objects/codeobject.c | 15 | ||||
-rw-r--r-- | Objects/exceptions.c | 2 | ||||
-rw-r--r-- | Objects/object.c | 14 | ||||
-rw-r--r-- | Objects/stringlib/codecs.h | 3 | ||||
-rw-r--r-- | Objects/stringlib/unicode_format.h | 14 | ||||
-rw-r--r-- | Objects/typeobject.c | 2 |
7 files changed, 2 insertions, 50 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index abbf3ee..1b67e02 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2367,8 +2367,6 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray) writer.use_bytearray = use_bytearray; assert(PyUnicode_Check(string)); - if (PyUnicode_READY(string)) - return NULL; hexlen = PyUnicode_GET_LENGTH(string); if (!PyUnicode_IS_ASCII(string)) { diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 9b54c61..ebae0a3 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -153,10 +153,6 @@ intern_string_constants(PyObject *tuple, int *modified) for (Py_ssize_t i = PyTuple_GET_SIZE(tuple); --i >= 0; ) { PyObject *v = PyTuple_GET_ITEM(tuple, i); if (PyUnicode_CheckExact(v)) { - if (PyUnicode_READY(v) == -1) { - return -1; - } - if (all_name_chars(v)) { PyObject *w = v; PyUnicode_InternInPlace(&v); @@ -546,17 +542,6 @@ remove_column_info(PyObject *locations) PyCodeObject * _PyCode_New(struct _PyCodeConstructor *con) { - /* Ensure that strings are ready Unicode string */ - if (PyUnicode_READY(con->name) < 0) { - return NULL; - } - if (PyUnicode_READY(con->qualname) < 0) { - return NULL; - } - if (PyUnicode_READY(con->filename) < 0) { - return NULL; - } - if (intern_strings(con->names) < 0) { return NULL; } diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 7bec739..e2a3f89 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2480,8 +2480,6 @@ my_basename(PyObject *name) int kind; const void *data; - if (PyUnicode_READY(name)) - return NULL; kind = PyUnicode_KIND(name); data = PyUnicode_DATA(name); size = PyUnicode_GET_LENGTH(name); diff --git a/Objects/object.c b/Objects/object.c index ece0c5e..824c4e4 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -560,11 +560,6 @@ PyObject_Repr(PyObject *v) Py_DECREF(res); return NULL; } -#ifndef Py_DEBUG - if (PyUnicode_READY(res) < 0) { - return NULL; - } -#endif return res; } @@ -583,10 +578,6 @@ PyObject_Str(PyObject *v) if (v == NULL) return PyUnicode_FromString("<NULL>"); if (PyUnicode_CheckExact(v)) { -#ifndef Py_DEBUG - if (PyUnicode_READY(v) < 0) - return NULL; -#endif return Py_NewRef(v); } if (Py_TYPE(v)->tp_str == NULL) @@ -618,11 +609,6 @@ PyObject_Str(PyObject *v) Py_DECREF(res); return NULL; } -#ifndef Py_DEBUG - if (PyUnicode_READY(res) < 0) { - return NULL; - } -#endif assert(_PyUnicode_CheckConsistency(res, 1)); return res; } 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; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b6771d3..0a57991 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4901,8 +4901,6 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value) } if (PyUnicode_Check(name)) { if (PyUnicode_CheckExact(name)) { - if (PyUnicode_READY(name) == -1) - return -1; Py_INCREF(name); } else { |