summaryrefslogtreecommitdiffstats
path: root/Modules/_randommodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_randommodule.c')
-rw-r--r--Modules/_randommodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 7ad4299..65d41f4 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -523,8 +523,9 @@ random_init(RandomObject *self, PyObject *args, PyObject *kwds)
PyObject *arg = NULL;
_randomstate *state = _randomstate_type(Py_TYPE(self));
- if (Py_IS_TYPE(self, (PyTypeObject *)state->Random_Type) &&
- !_PyArg_NoKeywords("Random()", kwds)) {
+ if ((Py_IS_TYPE(self, (PyTypeObject *)state->Random_Type) ||
+ Py_TYPE(self)->tp_init == ((PyTypeObject*)state->Random_Type)->tp_init) &&
+ !_PyArg_NoKeywords("Random", kwds)) {
return -1;
}