[3.13] gh-143880: Fix data race in functools.partial in free threading build (GH-143882) (#145435)

Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-03-02 22:31:46 +01:00 committed by GitHub
parent 609a6f43e3
commit fb340275c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1 @@
Fix data race in :func:`functools.partial` in the :term:`free threading` build.

View file

@ -220,7 +220,9 @@ partial_vectorcall_fallback(PyThreadState *tstate, partialobject *pto,
PyObject *const *args, size_t nargsf,
PyObject *kwnames)
{
#ifndef Py_GIL_DISABLED
pto->vectorcall = NULL;
#endif
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
return _PyObject_MakeTpCall(tstate, (PyObject *)pto,
args, nargs, kwnames);