[3.13] Revert "gh-115432: Add critical section variant that handles a NULL object (GH-115433)" (GH-118861) (#118872)

This reverts commit ad4f909e0e.

The API ended up not being used.
(cherry picked from commit 46c808172f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-05-10 01:06:35 +02:00 • committed by GitHub
parent 00ec116883
commit b62cb5234b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 38 deletions

View file

@ -49,15 +49,6 @@ test_critical_sections(PyObject *self, PyObject *Py_UNUSED(args))
Py_END_CRITICAL_SECTION2();
assert_nogil(!PyMutex_IsLocked(&d2->ob_mutex));
// Optional variant behaves the same if the object is non-NULL
Py_XBEGIN_CRITICAL_SECTION(d1);
assert_nogil(PyMutex_IsLocked(&d1->ob_mutex));
Py_XEND_CRITICAL_SECTION();
// No-op
Py_XBEGIN_CRITICAL_SECTION(NULL);
Py_XEND_CRITICAL_SECTION();
Py_DECREF(d2);
Py_DECREF(d1);
Py_RETURN_NONE;