check for valid callback in bind()
This commit is contained in:
parent
9823b821f5
commit
54da8e404b
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue