10000 fix · python/cpython@b714963 · GitHub
[go: up one dir, main page]

Skip to content

Commit b714963

Browse files
committed
fix
1 parent bb23e4b commit b714963

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

Objects/typeobject.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5695,7 +5695,7 @@ _PyType_CacheInitForSpecialization(PyHeapTypeObject *type, PyObject *init,
56955695
int
56965696
_PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
56975697
{
5698-
int can_cache = 0;
5698+
int ret = 0;
56995699
if (!type) {
57005700
return -1;
57015701
}
@@ -5706,19 +5706,14 @@ _PyType_CacheGetItemForSpecialization(PyTypeObject *type, PyObject *descriptor)
57065706
PyFunctionObject *func = (PyFunctionObject *)descriptor;
57075707
uint32_t version = _PyFunction_GetVersionForCurrentState(func);
57085708
if (!_PyFunction_IsVersionValid(version)) {
5709-
can_cache = -1;
5709+
ret = -1;
57105710
goto end;
57115711
}
5712-
#ifdef Py_GIL_DISABLED
5713-
can_cache = _PyObject_HasDeferredRefcount(descriptor);
5714-
#else
5715-
can_cache = 0;
5716-
#endif
57175712
FT_ATOMIC_STORE_PTR_RELEASE(ht->_spec_cache.getitem, descriptor);
57185713
FT_ATOMIC_STORE_UINT32_RELAXED(ht->_spec_cache.getitem_version, version);
57195714
end:
57205715
END_TYPE_LOCK();
5721-
return can_cache;
5716+
return ret;
57225717
}
57235718

57245719
PyObject *

Programs/test_frozenmain.h

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0