mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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;
|
||||
}
|
||||
|
|
|
@ -5955,12 +5955,7 @@ do { \
|
|||
if (PyModule_AddObjectRef(module, name, exc) < 0) goto error; \
|
||||
} while(0)
|
||||
|
||||
bases = PyTuple_Pack(1, PyExc_OSError);
|
||||
if (bases == NULL) {
|
||||
goto error;
|
||||
}
|
||||
PySSLErrorObject = PyType_FromSpecWithBases(&sslerror_type_spec, bases);
|
||||
Py_CLEAR(bases);
|
||||
PySSLErrorObject = PyType_FromSpecWithBases(&sslerror_type_spec, PyExc_OSError);
|
||||
if (PySSLErrorObject == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue