File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1600,6 +1600,8 @@ object.
16001600
16011601 Discard the internal Unicode buffer and destroy the writer instance.
16021602
1603+ If *writer * is ``NULL ``, no operation is performed.
1604+
16031605.. c :function :: int PyUnicodeWriter_WriteChar (PyUnicodeWriter *writer, Py_UCS4 ch)
16041606
16051607 Write the single Unicode character *ch * into *writer *.
Original file line number Diff line number Diff line change @@ -563,9 +563,7 @@ list_repr_impl(PyListObject *v)
563563 return PyUnicodeWriter_Finish (writer );
564564
565565error :
566- if (writer != NULL ) {
567- PyUnicodeWriter_Discard (writer );
568- }
566+ PyUnicodeWriter_Discard (writer );
569567 Py_ReprLeave ((PyObject * )v );
570568 return NULL ;
571569}
Original file line number Diff line number Diff line change @@ -13455,6 +13455,9 @@ PyUnicodeWriter_Create(Py_ssize_t length)
1345513455
1345613456void PyUnicodeWriter_Discard (PyUnicodeWriter * writer )
1345713457{
13458+ if (writer == NULL ) {
13459+ return ;
13460+ }
1345813461 _PyUnicodeWriter_Dealloc ((_PyUnicodeWriter * )writer );
1345913462 PyMem_Free (writer );
1346013463}
You can’t perform that action at this time.
0 commit comments