Skip to content

Commit

Permalink
address review: use type_module()
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Nov 2, 2024
1 parent 63b05a0 commit 777bc8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -7611,7 +7611,7 @@ type_add_method(PyTypeObject *type, PyMethodDef *meth)
descr = PyDescr_NewClassMethod(type, meth);
}
else if (meth->ml_flags & METH_STATIC) {
PyObject *mod = PyObject_GetAttr((PyObject*)type, &_Py_ID(__module__));
PyObject *mod = type_module(type);
PyErr_Clear();
PyObject *cfunc = PyCFunction_NewEx(meth, (PyObject*)type, mod);
Py_XDECREF(mod);
Expand Down

0 comments on commit 777bc8d

Please sign in to comment.