From f877ee24627259e61b1e887d2c5f984f5c4b6c06 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Fri, 23 Aug 2024 19:43:56 +1000 Subject: [PATCH 1/2] Remove comment from pystate --- Python/pystate.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Python/pystate.c b/Python/pystate.c index c44a28ca6d3ac8..6d1a6732b2023b 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -2379,10 +2379,6 @@ PyGILState_Release(PyGILState_STATE oldstate) } /* We must hold the GIL and have our thread state current */ - /* XXX - remove the check - the assert should be fine, - but while this is very new (April 2003), the extra check - by release-only users can't hurt. - */ if (!holds_gil(tstate)) { _Py_FatalErrorFormat(__func__, "thread state %p must be current when releasing", From 94c07682622fc0b1a14c4092e1babb3108be6565 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Fri, 23 Aug 2024 21:34:45 +1000 Subject: [PATCH 2/2] Remove unreachable assertion --- Python/pystate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Python/pystate.c b/Python/pystate.c index 6d1a6732b2023b..6dd403f01717d1 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -2384,7 +2384,6 @@ PyGILState_Release(PyGILState_STATE oldstate) "thread state %p must be current when releasing", tstate); } - assert(holds_gil(tstate)); --tstate->gilstate_counter; assert(tstate->gilstate_counter >= 0); /* illegal counter value */