@@ -152,9 +152,6 @@ ascii_escape_unicode(PyObject *pystr)
152152 Py_UCS1 * output ;
153153 int kind ;
154154
155- if (PyUnicode_READY (pystr ) == -1 )
156- return NULL ;
157-
158155 input_chars = PyUnicode_GET_LENGTH (pystr );
159156 input = PyUnicode_DATA (pystr );
160157 kind = PyUnicode_KIND (pystr );
@@ -218,9 +215,6 @@ escape_unicode(PyObject *pystr)
218215 int kind ;
219216 Py_UCS4 maxchar ;
220217
221- if (PyUnicode_READY (pystr ) == -1 )
222- return NULL ;
223-
224218 maxchar = PyUnicode_MAX_CHAR_VALUE (pystr );
225219 input_chars = PyUnicode_GET_LENGTH (pystr );
226220 input = PyUnicode_DATA (pystr );
@@ -377,9 +371,6 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
377371 const void * buf ;
378372 int kind ;
379373
380- if (PyUnicode_READY (pystr ) == -1 )
381- return 0 ;
382-
383374 _PyUnicodeWriter writer ;
384375 _PyUnicodeWriter_Init (& writer );
385376 writer .overallocate = 1 ;
@@ -675,9 +666,6 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
675666 int has_pairs_hook = (s -> object_pairs_hook != Py_None );
676667 Py_ssize_t next_idx ;
677668
678- if (PyUnicode_READY (pystr ) == -1 )
679- return NULL ;
680-
681669 str = PyUnicode_DATA (pystr );
682670 kind = PyUnicode_KIND (pystr );
683671 end_idx = PyUnicode_GET_LENGTH (pystr ) - 1 ;
@@ -801,9 +789,6 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
801789 PyObject * rval ;
802790 Py_ssize_t next_idx ;
803791
804- if (PyUnicode_READY (pystr ) == -1 )
805- return NULL ;
806-
807792 rval = PyList_New (0 );
808793 if (rval == NULL )
809794 return NULL ;
@@ -906,9 +891,6 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
906891 PyObject * numstr = NULL ;
907892 PyObject * custom_func ;
908893
909- if (PyUnicode_READY (pystr ) == -1 )
910- return NULL ;
911-
912894 str = PyUnicode_DATA (pystr );
913895 kind = PyUnicode_KIND (pystr );
914896 end_idx = PyUnicode_GET_LENGTH (pystr ) - 1 ;
@@ -1018,9 +1000,6 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
10181000 int kind ;
10191001 Py_ssize_t length ;
10201002
1021- if (PyUnicode_READY (pystr ) == -1 )
1022- return NULL ;
1023-
10241003 str = PyUnicode_DATA (pystr );
10251004 kind = PyUnicode_KIND (pystr );
10261005 length = PyUnicode_GET_LENGTH (pystr );
0 commit comments