Permalink
Browse files

Do not raise if poll_for_event has no event

Signed-off-by: Julien Danjou <julien@danjou.info>
  • Loading branch information...
1 parent b71d27e commit 3f49332db5a911e1e59b1819a7d6ed9d3714a35a @jd jd committed Jan 24, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/conn.c
View
@@ -456,8 +456,10 @@ xpybConn_poll_for_event(xpybConn *self, PyObject *args)
data = xcb_poll_for_event(self->conn);
if (data == NULL) {
- PyErr_SetString(PyExc_IOError, "I/O error on X server connection.");
- return NULL;
+ if (xpybConn_invalid(self->conn))
+ return NULL;
+ else
+ Py_RETURN_NONE;
}
if (data->response_type == 0) {

0 comments on commit 3f49332

Please sign in to comment.