[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Raise an exception if X*Display functions fail (#663294).



---
 pyanaconda/isys/isys.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 392a42c..e28fcad 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -603,6 +603,7 @@ static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args) {
     XkbStateRec state;
 
     if ((d = XOpenDisplay(NULL)) == NULL) {
+        PyErr_SetString(PyExc_RuntimeError, "XOpenDisplay failed");
         return NULL;
     }
 
@@ -610,6 +611,7 @@ static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args) {
     XkbGetState(d, XkbUseCoreKbd, &state);
 
     if (XCloseDisplay(d)) {
+        PyErr_SetString(PyExc_RuntimeError, "XCloseDisplay failed");
         return NULL;
     }
 
-- 
1.7.1.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]