mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-102471: Change PyLongWriter_Discard(NULL) to do nothing (#129339)
It's convenient to be able to call PyLongWriter_Discard(NULL) in error handling code.
This commit is contained in:
parent
11148e91e3
commit
7ec17429d4
2 changed files with 5 additions and 1 deletions
|
@ -6953,6 +6953,10 @@ error:
|
|||
void
|
||||
PyLongWriter_Discard(PyLongWriter *writer)
|
||||
{
|
||||
if (writer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
PyLongObject *obj = (PyLongObject *)writer;
|
||||
assert(Py_REFCNT(obj) == 1);
|
||||
Py_DECREF(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue