gh-128262: Allow specialization of calls to classes with __slots__ (GH-128263)

This commit is contained in:
Ken Jin 2024-12-31 12:24:17 +08:00 committed by GitHub
parent dafe7a4463
commit 7ef4907412
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 11 deletions

View file

@ -2002,10 +2002,6 @@ get_init_for_simple_managed_python_class(PyTypeObject *tp, unsigned int *tp_vers
return NULL;
}
unsigned long tp_flags = PyType_GetFlags(tp);
if ((tp_flags & Py_TPFLAGS_INLINE_VALUES) == 0) {
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_CALL_INIT_NOT_INLINE_VALUES);
return NULL;
}
if (!(tp_flags & Py_TPFLAGS_HEAPTYPE)) {
/* Is this possible? */
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_EXPECTED_ERROR);