File tree 3 files changed +6
-3
lines changed 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1600,6 +1600,8 @@ object.
1600
1600
1601
1601
Discard the internal Unicode buffer and destroy the writer instance.
1602
1602
1603
+ Do nothing if *writer * is ``NULL ``.
1604
+
1603
1605
.. c :function :: int PyUnicodeWriter_WriteChar (PyUnicodeWriter *writer, Py_UCS4 ch)
1604
1606
1605
1607
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)
563
563
return PyUnicodeWriter_Finish (writer );
564
564
565
565
error :
566
- if (writer != NULL ) {
567
- PyUnicodeWriter_Discard (writer );
568
- }
566
+ PyUnicodeWriter_Discard (writer );
569
567
Py_ReprLeave ((PyObject * )v );
570
568
return NULL ;
571
569
}
Original file line number Diff line number Diff line change @@ -13455,6 +13455,9 @@ PyUnicodeWriter_Create(Py_ssize_t length)
13455
13455
13456
13456
void PyUnicodeWriter_Discard (PyUnicodeWriter * writer )
13457
13457
{
13458
+ if (writer == NULL ) {
13459
+ return ;
13460
+ }
13458
13461
_PyUnicodeWriter_Dealloc ((_PyUnicodeWriter * )writer );
13459
13462
PyMem_Free (writer );
13460
13463
}
You can’t perform that action at this time.
0 commit comments