diff options
author | Julien Danjou <julien@danjou.info> | 2010-01-24 16:45:57 +0100 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2010-01-24 16:48:40 +0100 |
commit | 3f49332db5a911e1e59b1819a7d6ed9d3714a35a (patch) | |
tree | 3d347cf621c7d07323b84bf1a6b96880883aeb4a | |
parent | b71d27e5a640004d48788a83fafa58d34b7177ae (diff) |
Do not raise if poll_for_event has no event
Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r-- | src/conn.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) { |