bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)

This commit is contained in:
Serhiy Storchaka 2020-11-22 13:25:02 +02:00 committed by GitHub
parent c4d45ee670
commit 686c203cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 28 deletions

View file

@ -2038,21 +2038,14 @@ hashlib_init_evpxoftype(PyObject *module)
{
#ifdef PY_OPENSSL_HAS_SHAKE
_hashlibstate *state = get_hashlib_state(module);
PyObject *bases;
if (state->EVPtype == NULL) {
return -1;
}
bases = PyTuple_Pack(1, state->EVPtype);
if (bases == NULL) {
return -1;
}
state->EVPXOFtype = (PyTypeObject *)PyType_FromSpecWithBases(
&EVPXOFtype_spec, bases
&EVPXOFtype_spec, (PyObject *)state->EVPtype
);
Py_DECREF(bases);
if (state->EVPXOFtype == NULL) {
return -1;
}