check for valid callback in bind()

This commit is contained in:
Dana Jansens 2003-01-02 22:53:52 +00:00
parent 9823b821f5
commit 54da8e404b

View file

@ -99,6 +99,10 @@ PyObject * unregister_all(int action)
PyObject * bind(PyObject *keylist, PyObject *func)
{
if (!PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError, "Invalid callback function.");
return NULL;
}
if (!PyList_Check(keylist)) {
PyErr_SetString(PyExc_TypeError, "Invalid keylist. Not a list.");
return NULL;