Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Dec 8, 2024
1 parent 9dd7103 commit 2953fb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5723,6 +5723,9 @@ _PyType_GetItemFromCache(PyTypeObject *type)
BEGIN_TYPE_LOCK();
PyHeapTypeObject *ht = (PyHeapTypeObject *)type;
res = ht->_spec_cache.getitem;
if (res == NULL || !PyFunction_Check(res)) {
res = NULL;
}
END_TYPE_LOCK();
return res;
}
Expand All @@ -5737,6 +5740,10 @@ _PyType_GetItemFromCacheWithVersion(PyTypeObject *type, uint32_t *version)
if (res == NULL) {
goto end;
}
if (!PyFunction_Check(res)) {
res = NULL;
goto end;
}
*version = ht->_spec_cache.getitem_version;
end:
END_TYPE_LOCK();
Expand Down

0 comments on commit 2953fb4

Please sign in to comment.