Skip to content

Commit

Permalink
Fixed Loop.run return value
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Jan 6, 2013
1 parent 6feb666 commit f7859a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ new_loop(PyTypeObject *type, PyObject *args, PyObject *kwargs, int is_default)
static PyObject *
Loop_func_run(Loop *self, PyObject *args)
{
int mode = UV_RUN_DEFAULT;
int r;
int mode;

mode = UV_RUN_DEFAULT;

if (!PyArg_ParseTuple(args, "|i:run", &mode)) {
return NULL;
Expand All @@ -86,12 +89,14 @@ Loop_func_run(Loop *self, PyObject *args)
}

Py_BEGIN_ALLOW_THREADS
uv_run2(self->uv_loop, mode);
r = uv_run2(self->uv_loop, mode);
Py_END_ALLOW_THREADS

if (PyErr_Occurred()) {
handle_uncaught_exception(self);
}
Py_RETURN_NONE;

return PyBool_FromLong((long)r);
}


Expand Down

0 comments on commit f7859a3

Please sign in to comment.