WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [LIBXC] Python error extraction tweak.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [LIBXC] Python error extraction tweak.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Dec 2006 13:20:23 +0000
Delivery-date: Fri, 08 Dec 2006 05:20:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 5aea6a32fc8bfd1e1614e44b05ef349252ac58a0
# Parent  8e035701b9ffa91caf95e01cd89579ebb1f6bd98
[LIBXC] Python error extraction tweak.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/python/xen/lowlevel/xc/xc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 8e035701b9ff -r 5aea6a32fc8b tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Thu Dec 07 11:45:00 2006 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Thu Dec 07 11:46:07 2006 +0000
@@ -46,7 +46,10 @@ static PyObject *pyxc_error_to_exception
     const xc_error const *err = xc_get_last_error();
     const char *desc = xc_error_code_to_desc(err->code);
 
-    if (err->message[1])
+    if (err->code == XC_ERROR_NONE)
+        return PyErr_SetFromErrno(xc_error_obj);
+
+    if (err->message[0] != '\0')
        pyerr = Py_BuildValue("(iss)", err->code, desc, err->message);
     else
        pyerr = Py_BuildValue("(is)", err->code, desc);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [LIBXC] Python error extraction tweak., Xen patchbot-unstable <=