mirror of
https://git.kore.io/kore.git
synced 2024-11-16 15:06:37 +01:00
Small improvement to the Python kore.timer() api.
Do not allow kore.timer() to be called from the parent process as it shouldn't be run there. This makes Kore fail more gracefully.
This commit is contained in:
parent
f39919e98c
commit
f1a65ef236
@ -2441,6 +2441,12 @@ python_kore_timer(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
int flags;
|
||||
struct pytimer *timer;
|
||||
|
||||
if (worker == NULL) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"kore.timer not supported on parent process");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (!PyArg_ParseTuple(args, "OKi", &obj, &ms, &flags))
|
||||
return (NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user