Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 770a2be

Browse files
committed
These are true PyCFunctions, after adding the second argument to oss_self, no need to cast.
1 parent 09f24bb commit 770a2be

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Modules/ossaudiodev.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ oss_close(oss_audio_t *self, PyObject *unused)
470470
}
471471

472472
static PyObject *
473-
oss_self(PyObject *self)
473+
oss_self(PyObject *self, PyObject *unused)
474474
{
475475
Py_INCREF(self);
476476
return self;
@@ -800,8 +800,8 @@ static PyMethodDef oss_methods[] = {
800800
{ "flush", (PyCFunction)oss_sync, METH_VARARGS },
801801

802802
/* Support for the context manager protocol */
803-
{ "__enter__", (PyCFunction)oss_self, METH_NOARGS },
804-
{ "__exit__", (PyCFunction)oss_exit, METH_VARARGS },
803+
{ "__enter__", oss_self, METH_NOARGS },
804+
{ "__exit__", oss_exit, METH_VARARGS },
805805

806806
{ NULL, NULL} /* sentinel */
807807
};
@@ -812,8 +812,8 @@ static PyMethodDef oss_mixer_methods[] = {
812812
{ "fileno", (PyCFunction)oss_mixer_fileno, METH_NOARGS },
813813

814814
/* Support for the context manager protocol */
815-
{ "__enter__", (PyCFunction)oss_self, METH_NOARGS },
816-
{ "__exit__", (PyCFunction)oss_exit, METH_VARARGS },
815+
{ "__enter__", oss_self, METH_NOARGS },
816+
{ "__exit__", oss_exit, METH_VARARGS },
817817

818818
/* Simple ioctl wrappers */
819819
{ "controls", (PyCFunction)oss_mixer_controls, METH_VARARGS },

0 commit comments

Comments
 (0)