diff options
author | Victor Stinner <vstinner@python.org> | 2023-06-01 23:33:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 23:33:17 (GMT) |
commit | ef300937c2a1b3ebe19c2835f3b46585825c1e1f (patch) | |
tree | 34f151a390fb946ff985ed98e6c1bd096c4d090b /Modules/_csv.c | |
parent | cbb9ba844f15f2b8127028e6dfd4681b2cb2376f (diff) | |
download | cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.zip cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.gz cpython-ef300937c2a1b3ebe19c2835f3b46585825c1e1f.tar.bz2 |
gh-92536: Remove PyUnicode_READY() calls (#105210)
Since Python 3.12, PyUnicode_READY() does nothing and always
returns 0.
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r-- | Modules/_csv.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index 9ab2ad2..5b501af 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -266,7 +266,6 @@ _set_char_or_none(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt name); return -1; } - /* PyUnicode_READY() is called in PyUnicode_GetLength() */ *target = PyUnicode_READ_CHAR(src, 0); } } @@ -296,7 +295,6 @@ _set_char(const char *name, Py_UCS4 *target, PyObject *src, Py_UCS4 dflt) name); return -1; } - /* PyUnicode_READY() is called in PyUnicode_GetLength() */ *target = PyUnicode_READ_CHAR(src, 0); } return 0; @@ -316,8 +314,6 @@ _set_str(const char *name, PyObject **target, PyObject *src, const char *dflt) return -1; } else { - if (PyUnicode_READY(src) == -1) - return -1; Py_XSETREF(*target, Py_NewRef(src)); } } @@ -904,10 +900,6 @@ Reader_iternext(ReaderObj *self) Py_DECREF(lineobj); return NULL; } - if (PyUnicode_READY(lineobj) == -1) { - Py_DECREF(lineobj); - return NULL; - } ++self->line_num; kind = PyUnicode_KIND(lineobj); data = PyUnicode_DATA(lineobj); @@ -1185,8 +1177,6 @@ join_append(WriterObj *self, PyObject *field, int quoted) Py_ssize_t rec_len; if (field != NULL) { - if (PyUnicode_READY(field) == -1) - return 0; field_kind = PyUnicode_KIND(field); field_data = PyUnicode_DATA(field); field_len = PyUnicode_GET_LENGTH(field); @@ -1515,8 +1505,6 @@ csv_register_dialect(PyObject *module, PyObject *args, PyObject *kwargs) "dialect name must be a string"); return NULL; } - if (PyUnicode_READY(name_obj) == -1) - return NULL; dialect = _call_dialect(module_state, dialect_obj, kwargs); if (dialect == NULL) return NULL; |