Skip to content

Commit a31e962

Browse files
committed
These don't need to be freezable
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
1 parent f621a0c commit a31e962

4 files changed

Lines changed: 0 additions & 45 deletions

File tree

Lib/test/test_freeze/test_hashlib.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

Modules/_blake2/blake2b_impl.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ _blake2_blake2b_update(BLAKE2bObject *self, PyObject *data)
276276
{
277277
Py_buffer buf;
278278

279-
if(!Py_CHECKWRITE(self)){
280-
return PyErr_WriteToImmutable(self);
281-
}
282-
283279
GET_BUFFER_VIEW_OR_ERROUT(data, &buf);
284280

285281
if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE)

Modules/_blake2/blake2module.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ blake2_exec(PyObject *m)
8989
return -1;
9090
}
9191

92-
9392
PyObject *d = st->blake2b_type->tp_dict;
9493
ADD_INT(d, "SALT_SIZE", BLAKE2B_SALTBYTES);
9594
ADD_INT(d, "PERSON_SIZE", BLAKE2B_PERSONALBYTES);
@@ -112,23 +111,6 @@ blake2_exec(PyObject *m)
112111
return -1;
113112
}
114113

115-
PyObject *register_freezable = _PyImport_GetModuleAttrString("immutable", "register_freezable");
116-
if(register_freezable != NULL){
117-
PyObject *result = PyObject_CallFunctionObjArgs(register_freezable, st->blake2b_type, NULL);
118-
if(result == NULL){
119-
Py_DECREF(register_freezable);
120-
return -1;
121-
}
122-
123-
result = PyObject_CallFunctionObjArgs(register_freezable, st->blake2s_type, NULL);
124-
if(result == NULL){
125-
Py_DECREF(register_freezable);
126-
return -1;
127-
}
128-
129-
Py_DECREF(register_freezable);
130-
}
131-
132114
d = st->blake2s_type->tp_dict;
133115
ADD_INT(d, "SALT_SIZE", BLAKE2S_SALTBYTES);
134116
ADD_INT(d, "PERSON_SIZE", BLAKE2S_PERSONALBYTES);

Modules/_blake2/blake2s_impl.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ _blake2_blake2s_update(BLAKE2sObject *self, PyObject *data)
276276
{
277277
Py_buffer buf;
278278

279-
if(!Py_CHECKWRITE(self)){
280-
return PyErr_WriteToImmutable(self);
281-
}
282-
283279
GET_BUFFER_VIEW_OR_ERROUT(data, &buf);
284280

285281
if (self->lock == NULL && buf.len >= HASHLIB_GIL_MINSIZE)

0 commit comments

Comments
 (0)