mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)
This commit is contained in:
parent
c4d45ee670
commit
686c203cd4
7 changed files with 17 additions and 28 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue