8000 Make _PyStaticType_ClearWeakRefs have one implementation for default … · python/cpython@93425e6 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 93425e6

Browse files
committed
Make _PyStaticType_ClearWeakRefs have one implementation for default and free-threaded builds
1 parent b5c9561 commit 93425e6

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Objects/weakrefobject.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,6 @@ _PyStaticType_ClearWeakRefs(PyInterpreterState *interp, PyTypeObject *type)
11931193
{
11941194
static_builtin_state *state = _PyStaticType_GetState(interp, type);
11951195
PyObject **list = _PyStaticType_GET_WEAKREFS_LISTPTR(state);
1196-
#ifdef Py_GIL_DISABLED
11971196
for (int done = 0; !done;) {
11981197
PyObject *callback = NULL;
11991198
LOCK_WEAKREFS(type);
@@ -1204,14 +1203,6 @@ _PyStaticType_ClearWeakRefs(PyInterpreterState *interp, PyTypeObject *type)
12041203
UNLOCK_WEAKREFS(type);
12051204
Py_XDECREF(callback);
12061205
}
1207-
#else
1208-
while (*list != NULL) {
1209-
/* Note that clear_weakref() pops the first ref off the type's
1210-
weaklist before clearing its wr_object and wr_callback.
1211-
That is how we're able to loop over the list. */
1212-
clear_weakref((PyWeakReference *)*list);
1213-
}
1214-
#endif
12151206
}
12161207

12171208
void

0 commit comments

Comments
 (0)
0