mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
gh-135532: use defining_class for copying BLAKE-2 and SHA-3 objects (#135838)
This commit is contained in:
parent
34393cbdd4
commit
ef4fc86afa
5 changed files with 38 additions and 17 deletions
|
|
@ -787,17 +787,19 @@ blake2_blake2b_copy_unlocked(Blake2Object *self, Blake2Object *cpy)
|
|||
/*[clinic input]
|
||||
_blake2.blake2b.copy
|
||||
|
||||
cls: defining_class
|
||||
|
||||
Return a copy of the hash object.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
_blake2_blake2b_copy_impl(Blake2Object *self)
|
||||
/*[clinic end generated code: output=622d1c56b91c50d8 input=e383c2d199fd8a2e]*/
|
||||
_blake2_blake2b_copy_impl(Blake2Object *self, PyTypeObject *cls)
|
||||
/*[clinic end generated code: output=5f8ea31c56c52287 input=f38f3475e9aec98d]*/
|
||||
{
|
||||
int rc;
|
||||
Blake2Object *cpy;
|
||||
|
||||
if ((cpy = new_Blake2Object(Py_TYPE(self))) == NULL) {
|
||||
if ((cpy = new_Blake2Object(cls)) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue