Skip to content

Commit 8a4ae4c

Browse files
committed
Change default freezability of _random
1 parent 20abdf4 commit 8a4ae4c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Modules/_randommodule.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,13 @@ _random_exec(PyObject *module)
639639
if (state->Long___abs__ == NULL) {
640640
return -1;
641641
}
642+
643+
if (_PyImmutability_SetFreezable(module, _Py_FREEZABLE_NO) < 0
644+
|| _PyImmutability_SetFreezable(state->Random_Type, _Py_FREEZABLE_NO) < 0
645+
) {
646+
return -1;
647+
}
648+
642649
return 0;
643650
}
644651

0 commit comments

Comments
 (0)