Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix refleak
  • Loading branch information
pablogsal committed Oct 13, 2022
commit 19e8469cb8755a4a4b96e641eca69489be390485
4 changes: 3 additions & 1 deletion Python/suggestions.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ offer_suggestions_for_attribute_error(PyAttributeErrorObject *exc)
return NULL;
}
// Add a trailer ". Did you mean: (...)?"
return PyUnicode_FromFormat(". Did you mean %R?", suggestion);
PyObject* result = PyUnicode_FromFormat(". Did you mean %R?", suggestion);
Py_DECREF(suggestion);
return result;
}

static PyObject *
Expand Down