Visitar URL original
gh-104341: Clean Up threading Module by ericsnowcurrently · Pull Request #104552 · python/cpython · GitHub
Skip to content
Closed
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 _set_sentinel().
  • Loading branch information
ericsnowcurrently committed May 16, 2023
commit e2c7058abee4cd85c8d9e2773ec336edfe799267
4 changes: 3 additions & 1 deletion Modules/_threadmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,9 @@ thread__set_sentinel(PyObject *module, PyObject *Py_UNUSED(ignored))
hangs to the thread state. */
wr = PyWeakref_NewRef(lock, NULL);
if (wr == NULL) {
Py_DECREF(lock);
if (mt == NULL) {
Py_DECREF(lock);
}
return NULL;
}
tstate->on_delete_data = (void *) wr;
Expand Down