summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2010-01-24 16:45:57 +0100
committerJulien Danjou <julien@danjou.info>2010-01-24 16:48:40 +0100
commit3f49332db5a911e1e59b1819a7d6ed9d3714a35a (patch)
tree3d347cf621c7d07323b84bf1a6b96880883aeb4a
parentb71d27e5a640004d48788a83fafa58d34b7177ae (diff)
Do not raise if poll_for_event has no event
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--src/conn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/conn.c b/src/conn.c
index ddc262e..6838454 100644
--- a/src/conn.c
+++ b/src/conn.c
@@ -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) {